From 743fb6df30f3bc6210dd5020a4ae609869dccde8 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 15 Apr 2024 22:36:37 +0200 Subject: [PATCH] wayland: Add meta_wayland_seat_get_input_focus_client() call This call is meant to replace meta_wayland_keyboard_get_focus_client(), since we will always have a MetaWaylandSeat with an input focus (or not), but we may or may not have a MetaWaylandKeyboard. Part-of: --- src/wayland/meta-wayland-seat.c | 9 +++++++++ src/wayland/meta-wayland-seat.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c index ea4d4608c..7b225a660 100644 --- a/src/wayland/meta-wayland-seat.c +++ b/src/wayland/meta-wayland-seat.c @@ -720,3 +720,12 @@ meta_wayland_seat_get_current_surface (MetaWaylandSeat *seat, return NULL; } + +struct wl_client * +meta_wayland_seat_get_input_focus_client (MetaWaylandSeat *seat) +{ + if (seat->input_focus) + return wl_resource_get_client (seat->input_focus->resource); + else + return NULL; +} diff --git a/src/wayland/meta-wayland-seat.h b/src/wayland/meta-wayland-seat.h index 83fd7de1e..169a92e4e 100644 --- a/src/wayland/meta-wayland-seat.h +++ b/src/wayland/meta-wayland-seat.h @@ -98,3 +98,5 @@ MetaWaylandInput * meta_wayland_seat_get_input (MetaWaylandSeat *seat); MetaWaylandSurface * meta_wayland_seat_get_current_surface (MetaWaylandSeat *seat, ClutterInputDevice *device, ClutterEventSequence *sequence); + +struct wl_client * meta_wayland_seat_get_input_focus_client (MetaWaylandSeat *seat);