[PATCH 2/3] compositor: allow multiple input_device_attach()'s with a nil buffer

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Fri Mar 16 08:25:10 PDT 2012


Without this change, weston would crash whenever a nil buffer was
passed to input_device_attach() if the cursor sprite was not mapped.
While at it, change the unmapping code to use weston_surface_unmap().
---
 src/compositor.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index f2ae2f6..09b14ae 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1831,10 +1831,9 @@ input_device_attach(struct wl_client *client,
 	if (device->input_device.pointer_focus->resource.client != client)
 		return;
 
-	if (!buffer_resource && device->sprite->output) {
-		wl_list_remove(&device->sprite->link);
-		wl_list_remove(&device->sprite->layer_link);
-		device->sprite->output = NULL;
+	if (!buffer_resource) {
+		if (device->sprite->output)
+			weston_surface_unmap(device->sprite);
 		return;
 	}
 
-- 
1.7.4.1



More information about the wayland-devel mailing list