summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2023-12-14 18:23:52 +0100
committerMarge Bot <emma+marge@anholt.net>2024-03-18 23:34:29 +0000
commit122ad8a0dee8656e35cb9170f290aaac87f10462 (patch)
tree0cb66ede1d7e5464d69abc45b052462115a4299c
parent654c354da971d11bafd310d9821578bc64bd7936 (diff)
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 <ofourdan@redhat.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1213>
-rw-r--r--hw/xwayland/xwayland-screen.c11
-rw-r--r--hw/xwayland/xwayland-screen.h1
2 files changed, 12 insertions, 0 deletions
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 */