From 57db067cec418e9ae88f5c67ff49461a395dcb52 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 7 Dec 2010 15:08:16 -0500 Subject: [PATCH] Make wlsc_input_device_update_grab() take a grab object --- compositor/compositor.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/compositor/compositor.c b/compositor/compositor.c index 5c94d32..e989838 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -530,7 +530,7 @@ wlsc_input_device_start_grab(struct wlsc_input_device *device, static int wlsc_input_device_update_grab(struct wlsc_input_device *device, - enum wlsc_grab_type grab, + struct wl_grab *grab, struct wl_surface *surface, uint32_t time) { if (device->grab != WLSC_DEVICE_GRAB_MOTION || @@ -538,7 +538,7 @@ wlsc_input_device_update_grab(struct wlsc_input_device *device, device->input_device.pointer_focus != surface) return -1; - device->grab = grab; + device->grab_object = grab; return 0; } @@ -601,8 +601,7 @@ shell_move(struct wl_client *client, struct wl_shell *shell, move->dx = es->x - wd->grab_x; move->dy = es->y - wd->grab_y; - if (wlsc_input_device_update_grab(wd, WLSC_DEVICE_GRAB_MOVE, - surface, time) < 0) + if (wlsc_input_device_update_grab(wd, &move->grab, surface, time) < 0) return; wlsc_input_device_set_pointer_image(wd, WLSC_POINTER_DRAGGING); @@ -720,11 +719,10 @@ shell_resize(struct wl_client *client, struct wl_shell *shell, break; } - if (wlsc_input_device_update_grab(wd, edges, surface, time) < 0) + if (wlsc_input_device_update_grab(wd, &resize->grab, surface, time) < 0) return; wlsc_input_device_set_pointer_image(wd, pointer); - wd->grab_object = &resize->grab; } static void @@ -1231,11 +1229,10 @@ drag_activate(struct wl_client *client, struct wlsc_surface *target; int32_t sx, sy; - if (wlsc_input_device_update_grab(device, WLSC_DEVICE_GRAB_DRAG, - surface, time) < 0) + if (wlsc_input_device_update_grab(device, + &drag->grab, surface, time) < 0) return; - device->grab_object = &drag->grab; drag->grab.interface = &drag_grab_interface; drag->grab.input_device = input_device; -- 2.7.4