diff options
author | okan | 2015-08-24 15:42:57 +0000 |
---|---|---|
committer | okan | 2015-08-24 15:42:57 +0000 |
commit | f507af43cc37948b1f83ba74c8200059d4bba742 (patch) | |
tree | 6629cf1dd78ec54bda03a6198f59318e4378efed /xutil.c | |
parent | e76666595f56078b393ce83cc4f32f2cfd5f24b9 (diff) | |
download | cwm-f507af43cc37948b1f83ba74c8200059d4bba742.tar.gz |
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.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xutil.c,v 1.101 2015/08/24 14:56:10 okan Exp $ + * $OpenBSD: xutil.c,v 1.102 2015/08/24 15:42:57 okan Exp $ */ #include <sys/types.h> @@ -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], |