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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3420>
This commit is contained in:
Carlos Garnacho 2023-11-15 14:43:15 +01:00
parent a98f1b2764
commit 9c2514b75c
2 changed files with 11 additions and 0 deletions

View File

@ -1091,6 +1091,14 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
g_signal_emit (pointer, signals[FOCUS_SURFACE_CHANGED], 0); 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 void
meta_wayland_pointer_start_grab (MetaWaylandPointer *pointer, meta_wayland_pointer_start_grab (MetaWaylandPointer *pointer,
MetaWaylandPointerGrab *grab) MetaWaylandPointerGrab *grab)

View File

@ -161,3 +161,6 @@ void meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer);
gboolean meta_wayland_pointer_is_grabbed (MetaWaylandPointer *pointer); gboolean meta_wayland_pointer_is_grabbed (MetaWaylandPointer *pointer);
MetaWaylandSurface * meta_wayland_pointer_get_current_surface (MetaWaylandPointer *pointer); MetaWaylandSurface * meta_wayland_pointer_get_current_surface (MetaWaylandPointer *pointer);
void meta_wayland_pointer_focus_surface (MetaWaylandPointer *pointer,
MetaWaylandSurface *surface);