From 9c2514b75c2de72faca1d9a8e037f75dc0021d5a Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 15 Nov 2023 14:43:15 +0100 Subject: [PATCH] wayland: Add MetaWaylandPointer method to focus surface This method ATM hooks up with MetaWaylandPointer's grabbing mechanism, triggering a focus on the existing grab interface. Part-of: --- src/wayland/meta-wayland-pointer.c | 8 ++++++++ src/wayland/meta-wayland-pointer.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 67007ffb1..4103b62bf 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -1091,6 +1091,14 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer, g_signal_emit (pointer, signals[FOCUS_SURFACE_CHANGED], 0); } +void +meta_wayland_pointer_focus_surface (MetaWaylandPointer *pointer, + MetaWaylandSurface *surface) +{ + const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface; + interface->focus (pointer->grab, surface); +} + void meta_wayland_pointer_start_grab (MetaWaylandPointer *pointer, MetaWaylandPointerGrab *grab) diff --git a/src/wayland/meta-wayland-pointer.h b/src/wayland/meta-wayland-pointer.h index a28108d5f..9a64bad1b 100644 --- a/src/wayland/meta-wayland-pointer.h +++ b/src/wayland/meta-wayland-pointer.h @@ -161,3 +161,6 @@ void meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer); gboolean meta_wayland_pointer_is_grabbed (MetaWaylandPointer *pointer); MetaWaylandSurface * meta_wayland_pointer_get_current_surface (MetaWaylandPointer *pointer); + +void meta_wayland_pointer_focus_surface (MetaWaylandPointer *pointer, + MetaWaylandSurface *surface);