From 7fc49f742bd6086f3ada1f6429b0da9db0803912 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 26 Feb 2024 11:59:15 +0100 Subject: [PATCH] wayland: Add getter for the MetaWaylandPointer logical focus Even though the logical focus is typically business that only the MetaWaylandEventInterface mechanism minds about, there are some pointer subsystems that want to look this up, as opposed to the current surface. Add a getter to make this easier, without struct peeking. Part-of: --- src/wayland/meta-wayland-pointer.c | 6 ++++++ src/wayland/meta-wayland-pointer.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 985349539..6db9d33f8 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -1420,6 +1420,12 @@ meta_wayland_pointer_get_current_surface (MetaWaylandPointer *pointer) return pointer->current; } +MetaWaylandSurface * +meta_wayland_pointer_get_focus_surface (MetaWaylandPointer *pointer) +{ + return pointer->focus_surface; +} + MetaWaylandSurface * meta_wayland_pointer_get_implicit_grab_surface (MetaWaylandPointer *pointer) { diff --git a/src/wayland/meta-wayland-pointer.h b/src/wayland/meta-wayland-pointer.h index 56001b2e7..7b7578c92 100644 --- a/src/wayland/meta-wayland-pointer.h +++ b/src/wayland/meta-wayland-pointer.h @@ -119,6 +119,8 @@ void meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer); MetaWaylandSurface * meta_wayland_pointer_get_current_surface (MetaWaylandPointer *pointer); +MetaWaylandSurface * meta_wayland_pointer_get_focus_surface (MetaWaylandPointer *pointer); + void meta_wayland_pointer_focus_surface (MetaWaylandPointer *pointer, MetaWaylandSurface *surface);