From 2acc74a3db0834d0423e2fac9dfe824f57f2f235 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Tue, 6 Jun 2023 13:28:31 +0300 Subject: [PATCH] Clear input regions if they're ignored --- types/data_device/wlr_drag.c | 5 ++--- types/seat/wlr_seat_pointer.c | 1 + types/tablet_v2/wlr_tablet_v2_tool.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c index 0393f283..93614774 100644 --- a/types/data_device/wlr_drag.c +++ b/types/data_device/wlr_drag.c @@ -350,6 +350,7 @@ static void drag_handle_drag_source_destroy(struct wl_listener *listener, static void drag_icon_surface_role_commit(struct wlr_surface *surface) { assert(surface->role == &drag_icon_surface_role); + pixman_region32_clear(&surface->input_region); if (wlr_surface_has_buffer(surface)) { wlr_surface_map(surface); } @@ -383,9 +384,7 @@ static struct wlr_drag_icon *drag_icon_create(struct wlr_drag *drag, icon->surface->role_data = icon; - if (wlr_surface_has_buffer(surface)) { - wlr_surface_map(surface); - } + drag_icon_surface_role_commit(surface); return icon; } diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c index b5eb84f7..ab1bb830 100644 --- a/types/seat/wlr_seat_pointer.c +++ b/types/seat/wlr_seat_pointer.c @@ -71,6 +71,7 @@ struct wlr_seat_client *wlr_seat_client_from_pointer_resource( } static void pointer_cursor_surface_handle_commit(struct wlr_surface *surface) { + pixman_region32_clear(&surface->input_region); if (wlr_surface_has_buffer(surface)) { wlr_surface_map(surface); } diff --git a/types/tablet_v2/wlr_tablet_v2_tool.c b/types/tablet_v2/wlr_tablet_v2_tool.c index cbd98fe1..dffa64a4 100644 --- a/types/tablet_v2/wlr_tablet_v2_tool.c +++ b/types/tablet_v2/wlr_tablet_v2_tool.c @@ -17,6 +17,7 @@ static const struct wlr_tablet_tool_v2_grab_interface default_tool_grab_interface; static void tablet_tool_cursor_surface_handle_commit(struct wlr_surface *surface) { + pixman_region32_clear(&surface->input_region); if (wlr_surface_has_buffer(surface)) { wlr_surface_map(surface); }