events: Only process Enter/Leave events when in the normal route

This prevents issues from happening when processing Enter/Leave events
while in another kind of grab op like a Wayland popup or resizing a
window.

This can't ever really happen except outside of a race condition,
with the X server, since we won't ever pass input events to the
X server in any of these cases, but it can't hurt to be more correct
about what the intended operation is.
This commit is contained in:
Jasper St. Pierre 2014-09-16 20:28:13 -06:00
parent ae292c856b
commit c8cc4344f2

View File

@ -848,7 +848,7 @@ handle_input_xevent (MetaDisplay *display,
switch (input_event->evtype) switch (input_event->evtype)
{ {
case XI_Enter: case XI_Enter:
if (display->grab_op == META_GRAB_OP_COMPOSITOR) if (display->event_route != META_EVENT_ROUTE_NORMAL)
break; break;
/* Check if we've entered a window; do this even if window->has_focus to /* Check if we've entered a window; do this even if window->has_focus to
@ -867,7 +867,7 @@ handle_input_xevent (MetaDisplay *display,
} }
break; break;
case XI_Leave: case XI_Leave:
if (display->grab_op == META_GRAB_OP_COMPOSITOR) if (display->event_route != META_EVENT_ROUTE_NORMAL)
break; break;
if (window != NULL && if (window != NULL &&
@ -905,7 +905,6 @@ handle_input_xevent (MetaDisplay *display,
NULL, NULL,
meta_display_get_current_time_roundtrip (display)); meta_display_get_current_time_roundtrip (display));
} }
} }
break; break;
} }