The tablet tool's surface and view has to be set as mapped in
tablet_tool_cursor_surface_configure API otherwise the same view
can be added more than once to the cursor layer list when set_cursor
is called by the client. This will lead to corruption of cursor layer list.

And the tablet tool's surface should be unmapped only if the sprite is valid.

Signed-off-by: Maniraj Devadoss <Maniraj.Devadoss at in.bosch.com>
---
 libweston/input.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libweston/input.c b/libweston/input.c
index 778aabd..d7bcc8c 100644
--- a/libweston/input.c
+++ b/libweston/input.c
@@ -1361,7 +1361,7 @@ default_grab_tablet_tool_proximity_out(struct 
weston_tablet_tool_grab *grab,
        weston_tablet_tool_set_focus(tool, NULL, time);
 
        /* Hide the cursor */
-       if (weston_surface_is_mapped(tool->sprite->surface))
+       if (tool->sprite && weston_surface_is_mapped(tool->sprite->surface))
                weston_surface_unmap(tool->sprite->surface);
 }
 
@@ -2812,6 +2812,8 @@ tablet_tool_cursor_surface_configure(struct 
weston_surface *es,
                        &es->compositor->cursor_layer.view_list,
                        &tool->sprite->layer_link);
                weston_view_update_transform(tool->sprite);
+               es->is_mapped = true;
+               tool->sprite->is_mapped = true;
        }
 }
 
-- 
2.7.4

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to