summary refs log tree commit diff
path: root/xutil.c
diff options
context:
space:
mode:
authorokan <okan>2015-08-24 15:42:57 +0000
committerokan <okan>2015-08-24 15:42:57 +0000
commitdcfbc9e809623eee64e9df28fd8cfc754d1f6a6a (patch)
tree5c8a9ccd75deb129e1cfd82df3f2bc2a1f596d1e /xutil.c
parent97db17d0568c8dcb41173104af16b000879a36e4 (diff)
downloadcwm-dcfbc9e809623eee64e9df28fd8cfc754d1f6a6a.tar.gz
cwm-dcfbc9e809623eee64e9df28fd8cfc754d1f6a6a.tar.xz
cwm-dcfbc9e809623eee64e9df28fd8cfc754d1f6a6a.zip
Implement _NET_CLIENT_LIST_STACKING (from Thomas Admin), but
bottom-to-top order, as per spec (notified Thomas as well).
Diffstat (limited to 'xutil.c')
-rw-r--r--xutil.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xutil.c b/xutil.c
index 56e180c..f61aeef 100644
--- a/xutil.c
+++ b/xutil.c
@@ -229,6 +229,27 @@ xu_ewmh_net_client_list(struct screen_ctx *sc)
 }
 
 void
+xu_ewmh_net_client_list_stacking(struct screen_ctx *sc)
+{
+	struct client_ctx	*cc;
+	Window			*winlist;
+	int			 i = 0, j;
+
+	TAILQ_FOREACH(cc, &sc->clientq, entry)
+		i++;
+	if (i == 0)
+		return;
+
+	j = i;
+	winlist = xreallocarray(NULL, i, sizeof(*winlist));
+	TAILQ_FOREACH(cc, &sc->clientq, entry)
+		winlist[--j] = cc->win;
+	XChangeProperty(X_Dpy, sc->rootwin, ewmh[_NET_CLIENT_LIST_STACKING],
+	    XA_WINDOW, 32, PropModeReplace, (unsigned char *)winlist, i);
+	free(winlist);
+}
+
+void
 xu_ewmh_net_active_window(struct screen_ctx *sc, Window w)
 {
 	XChangeProperty(X_Dpy, sc->rootwin, ewmh[_NET_ACTIVE_WINDOW],