diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-03-14 17:20:08 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-03-14 17:20:10 +0200 |
| commit | d9c030b5c31636491c1c8cf803c7b827063de2e6 (patch) | |
| tree | 0c7e9998ea30bfa30cb0089e0e2fadb903eee7c4 /monsterwm.c | |
| parent | ec26c13de147ef048bb8070e11f96af4879faabd (diff) | |
set _NET_ACTIVE_WINDOW when requested
tools like `xdotool` can be used to select/focus
a window, using the _NET_ACTIVE_WINDOW property.
however those tools don't know or don't care about
the state of the window, ie the window is unmapped.
we workaround this by checking if the client that
requested that property is visible in the current
desktop. If not we discard the client message.
Diffstat (limited to 'monsterwm.c')
| -rw-r--r-- | monsterwm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/monsterwm.c b/monsterwm.c index b2ee3f0..6361d63 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -272,13 +272,13 @@ void client_to_desktop(const Arg *arg) { * * check if window requested fullscreen or activation */ void clientmessage(XEvent *e) { - client *c = wintoclient(e->xclient.window); + client *t = NULL, *c = wintoclient(e->xclient.window); if (c && e->xclient.message_type == netatoms[NET_WM_STATE] && ((unsigned)e->xclient.data.l[1] == netatoms[NET_FULLSCREEN] || (unsigned)e->xclient.data.l[2] == netatoms[NET_FULLSCREEN])) setfullscreen(c, (e->xclient.data.l[0] == 1 || (e->xclient.data.l[0] == 2 && !c->isfullscrn))); - //FIXME c may be on another desktop - //else if (c && e->xclient.message_type == netatoms[NET_ACTIVE]) update_current(c); + else if (c && e->xclient.message_type == netatoms[NET_ACTIVE]) for (t=head; t && t!=c; t=t->next); + if (t) update_current(c); tile(); } |
