Fix for FocusIn event handler

10.7.1 chapter of X11 ([0]) describes many cases when FocusIn event is
generated. We are interested only in one FocusIn event type - the one
that is sent to window that gains focus.
Previous 'if' failed in some cases ([1]), this one should be better.

[0]
http://cgit.freedesktop.org/xorg/doc/xorg-docs/plain/hardcopy/X11/xlib.PS.gz
page 211

[1] http://www.mail-archive.com/awesome-devel@naquadah.org/msg01958.html

Signed-off-by: Mariusz Ceier <mceier@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Mariusz Ceier 2009-04-03 13:05:03 +02:00 committed by Julien Danjou
parent 2e1582645e
commit fc705933ce
1 changed files with 2 additions and 5 deletions

View File

@ -559,11 +559,8 @@ event_handle_focusin(void *data __attribute__ ((unused)),
xcb_focus_in_event_t *ev)
{
/* filter focus-in events */
if(ev->mode != XCB_NOTIFY_MODE_NORMAL
&& (ev->detail == XCB_NOTIFY_DETAIL_VIRTUAL
|| ev->detail == XCB_NOTIFY_DETAIL_NONLINEAR_VIRTUAL
|| ev->detail == XCB_NOTIFY_DETAIL_POINTER))
return 0;
if (ev->detail != XCB_NOTIFY_DETAIL_NONLINEAR)
return 0;
client_t *c;