x11: Ignore FocusOut with mode = NotifyUngrab
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 19 Dec 2011 19:36:50 +0000 (14:36 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 19 Dec 2011 19:36:52 +0000 (14:36 -0500)
Not sure why we get these, but it happens for Alt-click to move a window
(metacity binding) and messes up the idle inhibit counter.
FocusOut event as a result of ungrabbing doesn't really make sense and
fortunately we can safely ignore them.

compositor/compositor-x11.c

index a781131..a18d537 100644 (file)
@@ -648,7 +648,8 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
 
                case XCB_FOCUS_OUT:
                        focus_in = (xcb_focus_in_event_t *) event;
-                       if (focus_in->mode == XCB_NOTIFY_MODE_WHILE_GRABBED)
+                       if (focus_in->mode == XCB_NOTIFY_MODE_WHILE_GRABBED ||
+                           focus_in->mode == XCB_NOTIFY_MODE_UNGRAB)
                                break;
                        notify_keyboard_focus(c->base.input_device,
                                              wlsc_compositor_get_time(),