[hackers] [dmenu] Set class name on menu window || Omar Sandoval

From: <git_AT_suckless.org>
Date: Fri, 3 Nov 2017 20:42:31 +0100 (CET)

commit 64ab2801fbbbcc028c359080ae4bd546fc871f67
Author: Omar Sandoval <osandov_AT_osandov.com>
AuthorDate: Fri Nov 3 09:49:10 2017 -0700
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Fri Nov 3 20:41:03 2017 +0100

    Set class name on menu window
    
    WM_CLASS is a standard ICCCM property which is used to identify windows.
    Window managers and compositors use it to allow per-application
    configurable behavior.

diff --git a/dmenu.c b/dmenu.c
index d605ab4..85e5060 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -545,6 +545,7 @@ setup(void)
         XIM xim;
         Window w, dw, *dws;
         XWindowAttributes wa;
+ XClassHint ch = {"dmenu", "dmenu"};
 #ifdef XINERAMA
         XineramaScreenInfo *info;
         Window pw;
_AT_@ -613,6 +614,7 @@ setup(void)
         win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
                             CopyFromParent, CopyFromParent, CopyFromParent,
                             CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
+ XSetClassHint(dpy, win, &ch);
 
         /* open input methods */
         xim = XOpenIM(dpy, NULL, NULL, NULL);
Received on Fri Nov 03 2017 - 20:42:31 CET

This archive was generated by hypermail 2.3.0 : Fri Nov 03 2017 - 20:48:25 CET