[hackers] [dwm] applied Andreas Amanns' netwm_client_list patch, but with some indentation fixes || anselm

From: <hg_AT_suckless.org>
Date: Sun, 25 Mar 2012 17:49:38 +0200 (CEST)

changeset: 1599:10e232f9ace7
tag: tip
user: anselm_AT_garbe.us
date: Sun Mar 25 17:49:35 2012 +0200
files: dwm.c
description:
applied Andreas Amanns' netwm_client_list patch, but with some indentation fixes


diff -r b3a37808454d -r 10e232f9ace7 dwm.c
--- a/dwm.c Sun Mar 25 17:46:03 2012 +0200
+++ b/dwm.c Sun Mar 25 17:49:35 2012 +0200
_AT_@ -60,7 +60,7 @@
 enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
 enum { NetSupported, NetWMName, NetWMState,
        NetWMFullscreen, NetActiveWindow, NetWMWindowType,
- NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */
+ NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
 enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
 enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
        ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
_AT_@ -238,6 +238,7 @@
 static Bool updategeom(void);
 static void updatebarpos(Monitor *m);
 static void updatebars(void);
+static void updateclientlist(void);
 static void updatenumlockmask(void);
 static void updatesizehints(Client *c);
 static void updatestatus(void);
_AT_@ -1160,6 +1161,8 @@
                 XRaiseWindow(dpy, c->win);
         attach(c);
         attachstack(c);
+ XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
+ (unsigned char *) &(c->win), 1);
         XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
         setclientstate(c, NormalState);
         if (c->mon == selmon)
_AT_@ -1621,6 +1624,7 @@
         netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False);
         netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
         netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False);
+ netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
         /* init cursors */
         cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
         cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
_AT_@ -1643,6 +1647,7 @@
         /* EWMH support per view */
         XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
                         PropModeReplace, (unsigned char *) netatom, NetLast);
+ XDeleteProperty(dpy, root, netatom[NetClientList]);
         /* select for events */
         wa.cursor = cursor[CurNormal];
         wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask|PointerMotionMask
_AT_@ -1820,6 +1825,7 @@
         }
         free(c);
         focus(NULL);
+ updateclientlist();
         arrange(m);
 }
 
_AT_@ -1868,6 +1874,19 @@
                 m->by = -bh;
 }
 
+void
+updateclientlist() {
+ Client *c;
+ Monitor *m;
+
+ XDeleteProperty(dpy, root, netatom[NetClientList]);
+ for(m = mons; m; m = m->next)
+ for(c = m->clients; c; c = c->next)
+ XChangeProperty(dpy, root, netatom[NetClientList],
+ XA_WINDOW, 32, PropModeAppend,
+ (unsigned char *) &(c->win), 1);
+}
+
 Bool
 updategeom(void) {
         Bool dirty = False;
Received on Sun Mar 25 2012 - 17:49:38 CEST

This archive was generated by hypermail 2.3.0 : Sun Mar 25 2012 - 18:00:10 CEST