[weston,v3,17/17] tablet: set the tablet tool surface and view as mapped

Submitted by Maniraj Devadoss on Dec. 19, 2017, 8:33 a.m.

Details

Message ID 1513672422-6010-18-git-send-email-Maniraj.Devadoss@in.bosch.com
State New
Headers show
Series "Tablet device support for weston" ( rev: 3 ) in Wayland

Not browsing as part of any series.

Commit Message

Maniraj Devadoss Dec. 19, 2017, 8:33 a.m.
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(-)

Patch hide | download patch | download mbox

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;
 	}
 }