about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-11-15 18:57:31 +0100
committerAnselm R. Garbe <garbeam@gmail.com>2007-11-15 18:57:31 +0100
commit762b66ae7c0cffb51bfbda8c52c4ecc892ae1808 (patch)
tree25a974ebf0a0e6026fc66dd1020c333660cf6f4a
parentcb4951dd54951611bb99924b9ae1d0a7c87f47cc (diff)
downloaddwm-762b66ae7c0cffb51bfbda8c52c4ecc892ae1808.tar.gz
hack that adds NET_SUPPORTING_WM_CHECK handling, dwm identifies itself as compiz, hence I believe this might workaround the JDK 1.6+ XToolkit bug
-rw-r--r--dwm.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index 1529372..88743c5 100644
--- a/dwm.c
+++ b/dwm.c
@@ -53,7 +53,7 @@
 enum { BarTop, BarBot, BarOff };			/* bar position */
 enum { CurNormal, CurResize, CurMove, CurLast };	/* cursor */
 enum { ColBorder, ColFG, ColBG, ColLast };		/* color */
-enum { NetSupported, NetWMName, NetLast };		/* EWMH atoms */
+enum { NetSupported, NetWMCheck, NetWMName, NetLast };	/* EWMH atoms */
 enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
 
 /* typedefs */
@@ -1427,19 +1427,20 @@ void
 setup(void) {
 	int d;
 	unsigned int i, j, mask;
+	Atom utf8string;
 	Window w;
 	XModifierKeymap *modmap;
 	XSetWindowAttributes wa;
 
 	/* init atoms */
+	utf8string = XInternAtom(dpy, "UTF8_STRING", False);
 	wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
 	wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
 	wmatom[WMName] = XInternAtom(dpy, "WM_NAME", False);
 	wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
 	netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
+	netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
 	netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
-	XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
-			PropModeReplace, (unsigned char *) netatom, NetLast);
 
 	/* init cursors */
 	cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
@@ -1514,6 +1515,17 @@ setup(void) {
 
 	/* multihead support */
 	selscreen = XQueryPointer(dpy, root, &w, &w, &d, &d, &d, &d, &mask);
+
+	/* EWMH properties */
+	XChangeProperty(dpy, barwin, netatom[NetWMCheck], XA_WINDOW, 32,
+			PropModeReplace, (unsigned char *) &barwin, 1);
+	/* HACK: dwm identifies itself as compiz to workaround the XToolkit bug of Sun JDK */
+	XChangeProperty(dpy, barwin, netatom[NetWMName], utf8string, 8,
+			PropModeReplace, (unsigned char *) "compiz", 7);
+	XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32,
+			PropModeReplace, (unsigned char *) &barwin, 1);
+	XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
+			PropModeReplace, (unsigned char *) netatom, NetLast);
 }
 
 void
#n217'>217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261