From 81df305645180c91a33df0a8bcac4ac5675418e8 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 27 Feb 2024 12:48:28 +0100 Subject: [PATCH] wayland: Add MetaWaylandSeat input focus getter This will be useful for MetaWaylandCompositor to get the current input focus for keyboard and other related devices. Part-of: --- src/wayland/meta-wayland-seat.c | 6 ++++++ src/wayland/meta-wayland-seat.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c index 4f1ccae9f..924573d7b 100644 --- a/src/wayland/meta-wayland-seat.c +++ b/src/wayland/meta-wayland-seat.c @@ -563,6 +563,12 @@ meta_wayland_seat_set_input_focus (MetaWaylandSeat *seat, meta_wayland_text_input_set_focus (seat->text_input, surface); } +MetaWaylandSurface * +meta_wayland_seat_get_input_focus (MetaWaylandSeat *seat) +{ + return seat->input_focus; +} + gboolean meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat, MetaWaylandSurface *surface, diff --git a/src/wayland/meta-wayland-seat.h b/src/wayland/meta-wayland-seat.h index 966f17327..83fd7de1e 100644 --- a/src/wayland/meta-wayland-seat.h +++ b/src/wayland/meta-wayland-seat.h @@ -72,6 +72,8 @@ gboolean meta_wayland_seat_handle_event (MetaWaylandSeat *seat, void meta_wayland_seat_set_input_focus (MetaWaylandSeat *seat, MetaWaylandSurface *surface); +MetaWaylandSurface * meta_wayland_seat_get_input_focus (MetaWaylandSeat *seat); + gboolean meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat, MetaWaylandSurface *surface, uint32_t serial,