From 6bd4468b25c54da040e9db95fd1397be92af99e8 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 30 Sep 2022 12:54:58 +0200 Subject: [PATCH] wayland: Move away from MetaEventRoute Use the current grab op for the same effect. Part-of: --- src/wayland/meta-wayland-pointer.c | 31 +++++++------------------- src/wayland/meta-wayland-tablet-tool.c | 15 +++++-------- 2 files changed, 13 insertions(+), 33 deletions(-) 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 (); } }