From 1da0355528dc8eb06aef0f995f203a484840947d Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 18 Apr 2019 19:21:37 +0200 Subject: [PATCH] wayland: Update tablet cursor outputs across cursor/proximity changes Make sure those generic surface events are sent early on when setting a cursor for any tablet tool, so clients can update to output characteristics. https://gitlab.gnome.org/GNOME/mutter/merge_requests/545 Related: https://gitlab.gnome.org/GNOME/gtk/issues/1675 --- src/wayland/meta-wayland-tablet-tool.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c index ffc05a63a..d243608cf 100644 --- a/src/wayland/meta-wayland-tablet-tool.c +++ b/src/wayland/meta-wayland-tablet-tool.c @@ -115,13 +115,24 @@ meta_wayland_tablet_tool_set_cursor_surface (MetaWaylandTabletTool *tool, return; if (tool->cursor_surface) - wl_list_remove (&tool->cursor_surface_destroy_listener.link); + { + MetaWaylandCursorSurface *cursor_surface; + + cursor_surface = META_WAYLAND_CURSOR_SURFACE (tool->cursor_surface->role); + meta_wayland_cursor_surface_set_renderer (cursor_surface, NULL); + + meta_wayland_surface_update_outputs (tool->cursor_surface); + wl_list_remove (&tool->cursor_surface_destroy_listener.link); + } tool->cursor_surface = surface; if (tool->cursor_surface) - wl_resource_add_destroy_listener (tool->cursor_surface->resource, - &tool->cursor_surface_destroy_listener); + { + meta_wayland_surface_update_outputs (tool->cursor_surface); + wl_resource_add_destroy_listener (tool->cursor_surface->resource, + &tool->cursor_surface_destroy_listener); + } meta_wayland_tablet_tool_update_cursor_surface (tool); }