diff options
| -rw-r--r-- | dwm.c | 16 |
1 files changed, 14 insertions, 2 deletions
| @@ -61,7 +61,7 @@ | |||
| 61 | /* enums */ | 61 | /* enums */ |
| 62 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ | 62 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ |
| 63 | enum { SchemeNorm, SchemeSel }; /* color schemes */ | 63 | enum { SchemeNorm, SchemeSel }; /* color schemes */ |
| 64 | enum { NetSupported, NetWMName, NetWMState, | 64 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, |
| 65 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, | 65 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, |
| 66 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ | 66 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ |
| 67 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ | 67 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ |
| @@ -267,7 +267,7 @@ static Scm *scheme; | |||
| 267 | static Display *dpy; | 267 | static Display *dpy; |
| 268 | static Drw *drw; | 268 | static Drw *drw; |
| 269 | static Monitor *mons, *selmon; | 269 | static Monitor *mons, *selmon; |
| 270 | static Window root; | 270 | static Window root, wmcheckwin; |
| 271 | 271 | ||
| 272 | /* configuration, allows nested code to access above variables */ | 272 | /* configuration, allows nested code to access above variables */ |
| 273 | #include "config.h" | 273 | #include "config.h" |
| @@ -485,6 +485,7 @@ cleanup(void) | |||
| 485 | drw_cur_free(drw, cursor[i]); | 485 | drw_cur_free(drw, cursor[i]); |
| 486 | for (i = 0; i < LENGTH(colors); i++) | 486 | for (i = 0; i < LENGTH(colors); i++) |
| 487 | free(scheme[i]); | 487 | free(scheme[i]); |
| 488 | XDestroyWindow(dpy, wmcheckwin); | ||
| 488 | drw_free(drw); | 489 | drw_free(drw); |
| 489 | XSync(dpy, False); | 490 | XSync(dpy, False); |
| 490 | XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); | 491 | XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); |
| @@ -1551,6 +1552,7 @@ setup(void) | |||
| 1551 | { | 1552 | { |
| 1552 | int i; | 1553 | int i; |
| 1553 | XSetWindowAttributes wa; | 1554 | XSetWindowAttributes wa; |
| 1555 | Atom utf8string; | ||
| 1554 | 1556 | ||
| 1555 | /* clean up any zombies immediately */ | 1557 | /* clean up any zombies immediately */ |
| 1556 | sigchld(0); | 1558 | sigchld(0); |
| @@ -1567,6 +1569,7 @@ setup(void) | |||
| 1567 | bh = drw->fonts->h + 2; | 1569 | bh = drw->fonts->h + 2; |
| 1568 | updategeom(); | 1570 | updategeom(); |
| 1569 | /* init atoms */ | 1571 | /* init atoms */ |
| 1572 | utf8string = XInternAtom(dpy, "UTF8_STRING", False); | ||
| 1570 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); | 1573 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); |
| 1571 | wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); | 1574 | wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); |
| 1572 | wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); | 1575 | wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); |
| @@ -1575,6 +1578,7 @@ setup(void) | |||
| 1575 | netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); | 1578 | netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); |
| 1576 | netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); | 1579 | netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); |
| 1577 | netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); | 1580 | netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); |
| 1581 | netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); | ||
| 1578 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); | 1582 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); |
| 1579 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); | 1583 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); |
| 1580 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); | 1584 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); |
| @@ -1590,6 +1594,14 @@ setup(void) | |||
| 1590 | /* init bars */ | 1594 | /* init bars */ |
| 1591 | updatebars(); | 1595 | updatebars(); |
| 1592 | updatestatus(); | 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 | /* EWMH support per view */ | 1605 | /* EWMH support per view */ |
| 1594 | XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, | 1606 | XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, |
| 1595 | PropModeReplace, (unsigned char *) netatom, NetLast); | 1607 | PropModeReplace, (unsigned char *) netatom, NetLast); |
