diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 9ae7eeb0a..6709d9b5a 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -327,24 +327,16 @@ sync_focus_surface (MetaWaylandPointer *pointer) return; } - switch (display->event_route) + if (display->grab_op == META_GRAB_OP_NONE) + { + const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface; + interface->focus (pointer->grab, pointer->current); + } + else { - case META_EVENT_ROUTE_WINDOW_OP: /* The compositor has a grab, so remove our focus... */ meta_wayland_pointer_set_focus (pointer, NULL); - break; - - case META_EVENT_ROUTE_NORMAL: - { - const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface; - interface->focus (pointer->grab, pointer->current); - } - break; - - default: - g_assert_not_reached (); } - } static void @@ -504,15 +496,8 @@ default_grab_focus (MetaWaylandPointerGrab *grab, if (pointer->button_count > 0) return; - switch (display->event_route) - { - case META_EVENT_ROUTE_WINDOW_OP: - return; - break; - - case META_EVENT_ROUTE_NORMAL: - break; - } + if (display->grab_op != META_GRAB_OP_NONE) + return; if (surface) { diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c index 44cfadeee..2982dce65 100644 --- a/src/wayland/meta-wayland-tablet-tool.c +++ b/src/wayland/meta-wayland-tablet-tool.c @@ -585,19 +585,14 @@ sync_focus_surface (MetaWaylandTabletTool *tool, return; } - switch (display->event_route) + if (display->grab_op == META_GRAB_OP_NONE) + { + meta_wayland_tablet_tool_set_focus (tool, tool->current, event); + } + else { - case META_EVENT_ROUTE_WINDOW_OP: /* The compositor has a grab, so remove our focus */ meta_wayland_tablet_tool_set_focus (tool, NULL, event); - break; - - case META_EVENT_ROUTE_NORMAL: - meta_wayland_tablet_tool_set_focus (tool, tool->current, event); - break; - - default: - g_assert_not_reached (); } }