diff options
author | oga <oga> | 2009-12-07 22:21:59 +0000 |
---|---|---|
committer | oga <oga> | 2009-12-07 22:21:59 +0000 |
commit | 3c60d854db25c4cf0c72a981b108bde0bbf933fd (patch) | |
tree | 6399a3f5f2b3a1331e986c93c5bc2a668430bca3 /client.c | |
parent | 3e309894c1d0f6ff9302109d72a0ffb25612d537 (diff) | |
download | cwm-3c60d854db25c4cf0c72a981b108bde0bbf933fd.tar.gz cwm-3c60d854db25c4cf0c72a981b108bde0bbf933fd.tar.xz cwm-3c60d854db25c4cf0c72a981b108bde0bbf933fd.zip |
Implement _NET_ACTIVE_WINDOW. for now just the informational hint is
supported, the client message to change this will be supported when all informational hints are working. ok okan@
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/client.c b/client.c index b0eb875..fed35de 100644 --- a/client.c +++ b/client.c @@ -23,6 +23,7 @@ static struct client_ctx *client_mrunext(struct client_ctx *); static struct client_ctx *client_mruprev(struct client_ctx *); +static void client_none(struct screen_ctx *); static void client_placecalc(struct client_ctx *); static void client_update(struct client_ctx *); static void client_gethints(struct client_ctx *); @@ -142,7 +143,7 @@ client_delete(struct client_ctx *cc) TAILQ_REMOVE(&Clientq, cc, entry); if (_curcc == cc) - _curcc = NULL; + client_none(sc); XFree(cc->size); @@ -202,12 +203,28 @@ client_setactive(struct client_ctx *cc, int fg) if (fg && _curcc != cc) { client_setactive(NULL, 0); _curcc = cc; + XChangeProperty(X_Dpy, sc->rootwin, _NET_ACTIVE_WINDOW, + XA_WINDOW, 32, PropModeReplace, + (unsigned char *)&cc->win, 1); } cc->active = fg; client_draw_border(cc); } +/* + * set when there is no active client + */ +static void +client_none(struct screen_ctx *sc) +{ + Window none = None; + + XChangeProperty(X_Dpy, sc->rootwin, _NET_ACTIVE_WINDOW, + XA_WINDOW, 32, PropModeReplace, (unsigned char *)&none, 1); + _curcc = NULL; +} + struct client_ctx * client_current(void) { @@ -399,7 +416,7 @@ client_hide(struct client_ctx *cc) xu_setstate(cc, IconicState); if (cc == _curcc) - _curcc = NULL; + client_none(cc->sc); } void |