diff options
| author | anselm@garbe.us <unknown> | 2012-03-25 17:49:35 +0200 |
|---|---|---|
| committer | anselm@garbe.us <unknown> | 2012-03-25 17:49:35 +0200 |
| commit | 3bfc43c3d01d710c4828d75a8a5a9b910ee90dff (patch) | |
| tree | ceb3ca3e990a3b5fea6bebc32a563f80f29a9d8a /dwm.c | |
| parent | applied Andreas Amann's netwm_active_window patch, thx (diff) | |
| download | dwm-3bfc43c3d01d710c4828d75a8a5a9b910ee90dff.tar.gz dwm-3bfc43c3d01d710c4828d75a8a5a9b910ee90dff.zip | |
applied Andreas Amanns' netwm_client_list patch, but with some indentation fixes
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 21 |
1 files changed, 20 insertions, 1 deletions
| @@ -60,7 +60,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ | |||
| 60 | enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ | 60 | enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ |
| 61 | enum { NetSupported, NetWMName, NetWMState, | 61 | enum { NetSupported, NetWMName, NetWMState, |
| 62 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, | 62 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, |
| 63 | NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */ | 63 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ |
| 64 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ | 64 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ |
| 65 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, | 65 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, |
| 66 | ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ | 66 | ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ |
| @@ -238,6 +238,7 @@ static void unmapnotify(XEvent *e); | |||
| 238 | static Bool updategeom(void); | 238 | static Bool updategeom(void); |
| 239 | static void updatebarpos(Monitor *m); | 239 | static void updatebarpos(Monitor *m); |
| 240 | static void updatebars(void); | 240 | static void updatebars(void); |
| 241 | static void updateclientlist(void); | ||
| 241 | static void updatenumlockmask(void); | 242 | static void updatenumlockmask(void); |
| 242 | static void updatesizehints(Client *c); | 243 | static void updatesizehints(Client *c); |
| 243 | static void updatestatus(void); | 244 | static void updatestatus(void); |
| @@ -1160,6 +1161,8 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 1160 | XRaiseWindow(dpy, c->win); | 1161 | XRaiseWindow(dpy, c->win); |
| 1161 | attach(c); | 1162 | attach(c); |
| 1162 | attachstack(c); | 1163 | attachstack(c); |
| 1164 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, | ||
| 1165 | (unsigned char *) &(c->win), 1); | ||
| 1163 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ | 1166 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ |
| 1164 | setclientstate(c, NormalState); | 1167 | setclientstate(c, NormalState); |
| 1165 | if (c->mon == selmon) | 1168 | if (c->mon == selmon) |
| @@ -1621,6 +1624,7 @@ setup(void) { | |||
| 1621 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); | 1624 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); |
| 1622 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); | 1625 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); |
| 1623 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); | 1626 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); |
| 1627 | netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); | ||
| 1624 | /* init cursors */ | 1628 | /* init cursors */ |
| 1625 | cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); | 1629 | cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); |
| 1626 | cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); | 1630 | cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); |
| @@ -1643,6 +1647,7 @@ setup(void) { | |||
| 1643 | /* EWMH support per view */ | 1647 | /* EWMH support per view */ |
| 1644 | XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, | 1648 | XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, |
| 1645 | PropModeReplace, (unsigned char *) netatom, NetLast); | 1649 | PropModeReplace, (unsigned char *) netatom, NetLast); |
| 1650 | XDeleteProperty(dpy, root, netatom[NetClientList]); | ||
| 1646 | /* select for events */ | 1651 | /* select for events */ |
| 1647 | wa.cursor = cursor[CurNormal]; | 1652 | wa.cursor = cursor[CurNormal]; |
| 1648 | wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask|PointerMotionMask | 1653 | wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask|PointerMotionMask |
| @@ -1820,6 +1825,7 @@ unmanage(Client *c, Bool destroyed) { | |||
| 1820 | } | 1825 | } |
| 1821 | free(c); | 1826 | free(c); |
| 1822 | focus(NULL); | 1827 | focus(NULL); |
| 1828 | updateclientlist(); | ||
| 1823 | arrange(m); | 1829 | arrange(m); |
| 1824 | } | 1830 | } |
| 1825 | 1831 | ||
| @@ -1868,6 +1874,19 @@ updatebarpos(Monitor *m) { | |||
| 1868 | m->by = -bh; | 1874 | m->by = -bh; |
| 1869 | } | 1875 | } |
| 1870 | 1876 | ||
| 1877 | void | ||
| 1878 | updateclientlist() { | ||
| 1879 | Client *c; | ||
| 1880 | Monitor *m; | ||
| 1881 | |||
| 1882 | XDeleteProperty(dpy, root, netatom[NetClientList]); | ||
| 1883 | for(m = mons; m; m = m->next) | ||
| 1884 | for(c = m->clients; c; c = c->next) | ||
| 1885 | XChangeProperty(dpy, root, netatom[NetClientList], | ||
| 1886 | XA_WINDOW, 32, PropModeAppend, | ||
| 1887 | (unsigned char *) &(c->win), 1); | ||
| 1888 | } | ||
| 1889 | |||
| 1871 | Bool | 1890 | Bool |
| 1872 | updategeom(void) { | 1891 | updategeom(void) { |
| 1873 | Bool dirty = False; | 1892 | Bool dirty = False; |
