[hackers] [dwm] applied Ivan Delalande's NET_SUPPORTING_WM_CHECK patch for gtk3 compatibility || Anselm R Garbe

From: <git_AT_suckless.org>
Date: Mon, 5 Dec 2016 10:10:32 +0100 (CET)

commit e63bf229485a576d68975dd4eb00c210394133ae
Author: Anselm R Garbe <garbeam_AT_gmail.com>
AuthorDate: Mon Dec 5 10:09:49 2016 +0100
Commit: Anselm R Garbe <garbeam_AT_gmail.com>
CommitDate: Mon Dec 5 10:09:49 2016 +0100

    applied Ivan Delalande's NET_SUPPORTING_WM_CHECK patch for gtk3 compatibility

diff --git a/dwm.c b/dwm.c
index 3d6cc28..ca6f679 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -61,7 +61,7 @@
 /* enums */
 enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
 enum { SchemeNorm, SchemeSel }; /* color schemes */
-enum { NetSupported, NetWMName, NetWMState,
+enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
        NetWMFullscreen, NetActiveWindow, NetWMWindowType,
        NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
 enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
_AT_@ -267,7 +267,7 @@ static Scm *scheme;
 static Display *dpy;
 static Drw *drw;
 static Monitor *mons, *selmon;
-static Window root;
+static Window root, wmcheckwin;
 
 /* configuration, allows nested code to access above variables */
 #include "config.h"
_AT_@ -485,6 +485,7 @@ cleanup(void)
                 drw_cur_free(drw, cursor[i]);
         for (i = 0; i < LENGTH(colors); i++)
                 free(scheme[i]);
+ XDestroyWindow(dpy, wmcheckwin);
         drw_free(drw);
         XSync(dpy, False);
         XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
_AT_@ -1551,6 +1552,7 @@ setup(void)
 {
         int i;
         XSetWindowAttributes wa;
+ Atom utf8string;
 
         /* clean up any zombies immediately */
         sigchld(0);
_AT_@ -1567,6 +1569,7 @@ setup(void)
         bh = drw->fonts->h + 2;
         updategeom();
         /* init atoms */
+ utf8string = XInternAtom(dpy, "UTF8_STRING", False);
         wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
         wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
         wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
_AT_@ -1575,6 +1578,7 @@ setup(void)
         netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
         netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
         netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
+ netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
         netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
         netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
         netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
_AT_@ -1590,6 +1594,14 @@ setup(void)
         /* init bars */
         updatebars();
         updatestatus();
+ /* supporting window for NetWMCheck */
+ wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0);
+ XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32,
+ PropModeReplace, (unsigned char *) &wmcheckwin, 1);
+ XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8,
+ PropModeReplace, (unsigned char *) "dwm", 4);
+ XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32,
+ PropModeReplace, (unsigned char *) &wmcheckwin, 1);
         /* EWMH support per view */
         XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
                         PropModeReplace, (unsigned char *) netatom, NetLast);
Received on Mon Dec 05 2016 - 10:10:32 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 05 2016 - 10:12:35 CET