[dev] [dwm] [PATCH] support _NET_SUPPORTING_WM_CHECK

From: Jason Woofenden <jason_AT_jasonwoof.com>
Date: Wed, 6 May 2015 16:25:13 -0400

As documented here: http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#idm140130317670464
---
I developed this in the hopes that it would fix issues with feh running
fullscreen. It didn't help with that (feh using the innacurate _MOTIF_WM_HINTS
method) but it should at least stop gtk+ 3.3.8+ from polling regularly for WM
features.
The change to gtk+ is discussed here: https://bugzilla.gnome.org/show_bug.cgi?id=666921
 dwm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dwm.c b/dwm.c
index 169adcb..1e53a68 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -62,7 +62,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
 enum { SchemeNorm, SchemeSel, SchemeLast }; /* color schemes */
 enum { NetSupported, NetWMName, NetWMState,
        NetWMFullscreen, NetActiveWindow, NetWMWindowType,
-       NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
+       NetWMWindowTypeDialog, NetClientList, NetSupportingWMCheck, NetLast }; /* EWMH atoms */
 enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
 enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
        ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
_AT_@ -1526,6 +1526,7 @@ setup(void) {
 	netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
 	netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
 	netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
+	netatom[NetSupportingWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
 	/* init cursors */
 	cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
 	cursor[CurResize] = drw_cur_create(drw, XC_sizing);
_AT_@ -1744,6 +1745,12 @@ updatebars(void) {
 		m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
 		                          CopyFromParent, DefaultVisual(dpy, screen),
 		                          CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
+		XChangeProperty(dpy, root, netatom[NetSupportingWMCheck], XA_WINDOW, 32,
+		                PropModeReplace, (unsigned char *) &(m->barwin), 1);
+		XChangeProperty(dpy, m->barwin, netatom[NetSupportingWMCheck], XA_WINDOW, 32,
+		                PropModeReplace, (unsigned char *) &(m->barwin), 1);
+		XChangeProperty(dpy, m->barwin, netatom[NetWMName], XA_STRING, 8,
+		                PropModeReplace, (unsigned char *) "dwm", 3);
 		XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
 		XMapRaised(dpy, m->barwin);
 	}
-- 
2.1.4
Received on Wed May 06 2015 - 22:25:13 CEST

This archive was generated by hypermail 2.3.0 : Wed May 06 2015 - 22:36:08 CEST