]> git.sur5r.net Git - i3/i3/commit
bugfix: don't set input focus if not accepted
authorTony Crisci <tony@dubstepdish.com>
Tue, 17 Jun 2014 06:49:39 +0000 (02:49 -0400)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 19 Jun 2014 09:55:28 +0000 (11:55 +0200)
commit8a618e4b006000cbd521031f4c191e862da03914
tree1b141c008551f1d838415985a8305265c3a33b2e
parentb47f480728a6d053c117e4b99ee4c78d99ba6a71
bugfix: don't set input focus if not accepted

http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7

> Clients using the Globally Active model can only use a SetInputFocus request
> to acquire the input focus when they do not already have it on receipt of one
> of the following events:
> * ButtonPress
> * ButtonRelease
> * Passive-grabbed KeyPress
> * Passive-grabbed KeyRelease

Since managing a window happens on a MapNotify (which is absent from this
list), the window cannot accept input focus, so we should not try to focus
the window at all.

Fixes an issue with xfce4-notifyd which (correctly) declines focus when
we send WM_TAKE_FOCUS, which puts i3 in a state where i3 focus and X
focus are different when a notification appears.
src/ewmh.c
src/manage.c
testcases/t/158-wm_take_focus.t