From 122ad8a0dee8656e35cb9170f290aaac87f10462 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 14 Dec 2023 18:23:52 +0100 Subject: [PATCH] xwayland: Introduce xwl_screen_lost_focus() xwl_screen_lost_focus() calls the keyboard and pointer leave functions for each seat. No functional change. Signed-off-by: Olivier Fourdan Part-of: --- hw/xwayland/xwayland-screen.c | 11 +++++++++++ hw/xwayland/xwayland-screen.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index b1fce53ae..16e95f900 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -744,6 +744,17 @@ xwl_screen_get_next_output_serial(struct xwl_screen *xwl_screen) return xwl_screen->output_name_serial++; } +void +xwl_screen_lost_focus(struct xwl_screen *xwl_screen) +{ + struct xwl_seat *xwl_seat; + + xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { + xwl_seat_leave_ptr(xwl_seat, TRUE); + xwl_seat_leave_kbd(xwl_seat); + } +} + Bool xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) { diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h index 2f0922a21..dae6445c2 100644 --- a/hw/xwayland/xwayland-screen.h +++ b/hw/xwayland/xwayland-screen.h @@ -164,5 +164,6 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, struct wl_surface *surface, int32_t x, int32_t y, int32_t width, int32_t height); int xwl_screen_get_next_output_serial(struct xwl_screen * xwl_screen); +void xwl_screen_lost_focus(struct xwl_screen *xwl_screen); #endif /* XWAYLAND_SCREEN_H */