[hackers] [dwm] 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

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Thu Nov 15 18:58:10 2007

changeset: 1063:664b404421fe
tag: tip
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Thu Nov 15 18:57:31 2007 +0100
summary: 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

diff -r 767e76426fda -r 664b404421fe dwm.c
--- a/dwm.c Sat Nov 10 20:21:22 2007 +0100
+++ b/dwm.c Thu Nov 15 18:57:31 2007 +0100
@@ -53,7 +53,7 @@ enum { BarTop, BarBot, BarOff }; /* ba
 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 @@ setup(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
Received on Thu Nov 15 2007 - 18:58:10 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:47 UTC