[weston PATCH] shell: pass client to start_pointer_grab

Ander Conselvan de Oliveira conselvan2 at gmail.com
Fri Mar 2 05:45:58 PST 2012


Fix compositor crashes when the clients die before the grab ends.
---
 src/shell.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index 5abfdb5..8a82ad1 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -224,7 +224,8 @@ weston_surface_move(struct weston_surface *es,
 	move->dy = es->geometry.y - wd->input_device.grab_y;
 	move->surface = es;
 
-	wl_input_device_start_pointer_grab(&wd->input_device, &move->grab, time);
+	wl_input_device_start_pointer_grab(&wd->input_device, &move->grab,
+					   time, es->surface.resource.client);
 
 	wl_input_device_set_pointer_focus(&wd->input_device, NULL, time, 0, 0);
 
@@ -333,7 +334,8 @@ weston_surface_resize(struct shell_surface *shsurf,
 	resize->height = shsurf->surface->geometry.height;
 	resize->shsurf = shsurf;
 
-	wl_input_device_start_pointer_grab(&wd->input_device, &resize->grab, time);
+	wl_input_device_start_pointer_grab(&wd->input_device, &resize->grab,
+					   time, shsurf->resource.client);
 
 	wl_input_device_set_pointer_focus(&wd->input_device, NULL, time, 0, 0);
 
@@ -738,7 +740,9 @@ shell_map_popup(struct shell_surface *shsurf, uint32_t time)
 	shsurf->popup.initial_up = 0;
 
 	wl_input_device_start_pointer_grab(shsurf->popup.grab.input_device,
-				   &shsurf->popup.grab, shsurf->popup.time);
+					   &shsurf->popup.grab,
+					   shsurf->popup.time,
+					   shsurf->resource.client);
 }
 
 static void
@@ -1355,7 +1359,8 @@ rotate_binding(struct wl_input_device *device, uint32_t time,
 				 surface->surface->geometry.height / 2,
 				 &rotate->center.x, &rotate->center.y);
 
-	wl_input_device_start_pointer_grab(device, &rotate->grab, time);
+	wl_input_device_start_pointer_grab(device, &rotate->grab, time,
+					   surface->surface.resource.client);
 
 	dx = device->x - rotate->center.x;
 	dy = device->y - rotate->center.y;
-- 
1.7.5.4



More information about the wayland-devel mailing list