applied Ivan Delalande's NET_SUPPORTING_WM_CHECK patch for gtk3 compatibility
e63bf229
1 file(s) · +14 −2
| 61 | 61 | /* enums */ |
|
| 62 | 62 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ |
|
| 63 | 63 | enum { SchemeNorm, SchemeSel }; /* color schemes */ |
|
| 64 | - | enum { NetSupported, NetWMName, NetWMState, |
|
| 64 | + | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, |
|
| 65 | 65 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, |
|
| 66 | 66 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ |
|
| 67 | 67 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ |
|
| 267 | 267 | static Display *dpy; |
|
| 268 | 268 | static Drw *drw; |
|
| 269 | 269 | static Monitor *mons, *selmon; |
|
| 270 | - | static Window root; |
|
| 270 | + | static Window root, wmcheckwin; |
|
| 271 | 271 | ||
| 272 | 272 | /* configuration, allows nested code to access above variables */ |
|
| 273 | 273 | #include "config.h" |
|
| 485 | 485 | drw_cur_free(drw, cursor[i]); |
|
| 486 | 486 | for (i = 0; i < LENGTH(colors); i++) |
|
| 487 | 487 | free(scheme[i]); |
|
| 488 | + | XDestroyWindow(dpy, wmcheckwin); |
|
| 488 | 489 | drw_free(drw); |
|
| 489 | 490 | XSync(dpy, False); |
|
| 490 | 491 | XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); |
|
| 1551 | 1552 | { |
|
| 1552 | 1553 | int i; |
|
| 1553 | 1554 | XSetWindowAttributes wa; |
|
| 1555 | + | Atom utf8string; |
|
| 1554 | 1556 | ||
| 1555 | 1557 | /* clean up any zombies immediately */ |
|
| 1556 | 1558 | sigchld(0); |
|
| 1567 | 1569 | bh = drw->fonts->h + 2; |
|
| 1568 | 1570 | updategeom(); |
|
| 1569 | 1571 | /* init atoms */ |
|
| 1572 | + | utf8string = XInternAtom(dpy, "UTF8_STRING", False); |
|
| 1570 | 1573 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); |
|
| 1571 | 1574 | wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); |
|
| 1572 | 1575 | wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); |
|
| 1575 | 1578 | netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); |
|
| 1576 | 1579 | netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); |
|
| 1577 | 1580 | netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); |
|
| 1581 | + | netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); |
|
| 1578 | 1582 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); |
|
| 1579 | 1583 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); |
|
| 1580 | 1584 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); |
|
| 1590 | 1594 | /* init bars */ |
|
| 1591 | 1595 | updatebars(); |
|
| 1592 | 1596 | updatestatus(); |
|
| 1597 | + | /* supporting window for NetWMCheck */ |
|
| 1598 | + | wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); |
|
| 1599 | + | XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, |
|
| 1600 | + | PropModeReplace, (unsigned char *) &wmcheckwin, 1); |
|
| 1601 | + | XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8, |
|
| 1602 | + | PropModeReplace, (unsigned char *) "dwm", 4); |
|
| 1603 | + | XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32, |
|
| 1604 | + | PropModeReplace, (unsigned char *) &wmcheckwin, 1); |
|
| 1593 | 1605 | /* EWMH support per view */ |
|
| 1594 | 1606 | XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, |
|
| 1595 | 1607 | PropModeReplace, (unsigned char *) netatom, NetLast); |
|