From 44f250a7e8eb86d3f41da5d186d839e7a14648a3 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 27 May 2015 18:42:00 +0200 Subject: [PATCH] xwayland: Remove related touchpoints when unrealizing windows These sequences are forgotten to all purposes. Signed-off-by: Carlos Garnacho Reviewed-by: Olivier Fourdan --- hw/xwayland/xwayland-input.c | 14 ++++++++++++++ hw/xwayland/xwayland.c | 6 +++--- hw/xwayland/xwayland.h | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index ef38e6af9..d26a7863a 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -844,6 +844,20 @@ DDXRingBell(int volume, int pitch, int duration) { } +void +xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window) +{ + struct xwl_touch *xwl_touch, *next_xwl_touch; + + xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, + &xwl_seat->touches, link_touch) { + if (xwl_touch->window->window == window) { + xorg_list_del(&xwl_touch->link_touch); + free(xwl_touch); + } + } +} + void InitInput(int argc, char *argv[]) { diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index bc92beb38..f25bc006b 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -287,10 +287,10 @@ xwl_unrealize_window(WindowPtr window) xwl_screen = xwl_screen_get(screen); xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { - if (!xwl_seat->focus_window) - continue; - if (xwl_seat->focus_window->window == window) + if (xwl_seat->focus_window && xwl_seat->focus_window->window == window) xwl_seat->focus_window = NULL; + + xwl_seat_clear_touch(xwl_seat, window); } screen->UnrealizeWindow = xwl_screen->UnrealizeWindow; diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index 857650edc..53ca420cf 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -159,6 +159,8 @@ void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); void xwl_seat_destroy(struct xwl_seat *xwl_seat); +void xwl_seat_clear_touch(struct xwl_seat *xwl_seat, WindowPtr window); + Bool xwl_screen_init_output(struct xwl_screen *xwl_screen); struct xwl_output *xwl_output_create(struct xwl_screen *xwl_screen,