diff --git a/src/x11/events.c b/src/x11/events.c index 3362f5c6f..1584afb7c 100644 --- a/src/x11/events.c +++ b/src/x11/events.c @@ -675,7 +675,7 @@ meta_spew_event (MetaDisplay *display, g_free (extra); } -static void +static gboolean handle_window_focus_event (MetaDisplay *display, MetaWindow *window, XIEnterEvent *event) @@ -751,7 +751,7 @@ handle_window_focus_event (MetaDisplay *display, { meta_topic (META_DEBUG_FOCUS, "Ignoring focus event generated by a grab or other weirdness\n"); - return; + return FALSE; } if (event->evtype == XI_FocusIn) @@ -767,7 +767,7 @@ handle_window_focus_event (MetaDisplay *display, /* This event means the client moved focus to a subwindow */ meta_topic (META_DEBUG_FOCUS, "Ignoring focus out with NotifyInferior\n"); - return; + return FALSE; } display->server_focus_window = None; @@ -775,7 +775,7 @@ handle_window_focus_event (MetaDisplay *display, focus_window = NULL; } else - g_return_if_reached (); + g_assert_not_reached (); /* If display->focused_by_us, then the focus_serial will be used only * for a focus change we made and have already accounted for. @@ -791,6 +791,11 @@ handle_window_focus_event (MetaDisplay *display, focus_window ? focus_window->xwindow : None, display->server_focus_serial, FALSE); + return TRUE; + } + else + { + return FALSE; } } @@ -874,13 +879,9 @@ handle_input_xevent (MetaDisplay *display, break; case XI_FocusIn: case XI_FocusOut: - handle_window_focus_event (display, window, enter_event); - if (!window) + if (handle_window_focus_event (display, window, enter_event) && + enter_event->event == enter_event->root) { - /* Check if the window is a root window. */ - if (enter_event->root != enter_event->event) - break; - if (enter_event->evtype == XI_FocusIn && enter_event->detail == XINotifyDetailNone) {