From 225a1768822761af1caa2a73b703822d7ad2db5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 17 Aug 2010 13:14:24 -0400 Subject: [PATCH] Split GRAB_MOTION and GRAB_MOVE handling --- compositor.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/compositor.c b/compositor.c index 00da446..5a2bada 100644 --- a/compositor.c +++ b/compositor.c @@ -671,12 +671,6 @@ pick_surface(struct wlsc_input_device *device, int32_t *sx, int32_t *sy) struct wlsc_compositor *ec = device->ec; struct wlsc_surface *es; - if (device->grab != WLSC_DEVICE_GRAB_NONE) { - wlsc_surface_transform(device->pointer_focus, - device->x, device->y, sx, sy); - return device->pointer_focus; - } - wl_list_for_each(es, &ec->surface_list, link) { wlsc_surface_transform(es, device->x, device->y, sx, sy); if (0 <= *sx && *sx < es->width && @@ -711,18 +705,23 @@ notify_motion(struct wlsc_input_device *device, uint32_t time, int x, int y) switch (device->grab) { case WLSC_DEVICE_GRAB_NONE: - case WLSC_DEVICE_GRAB_MOTION: es = pick_surface(device, &sx, &sy); - wlsc_input_device_set_pointer_focus(device, es, time, x, y, sx, sy); - if (es) wl_surface_post_event(&es->base, &device->base.base, WL_INPUT_DEVICE_MOTION, time, x, y, sx, sy); break; + case WLSC_DEVICE_GRAB_MOTION: + es = device->pointer_focus; + wlsc_surface_transform(es, x, y, &sx, &sy); + wl_surface_post_event(&es->base, &device->base.base, + WL_INPUT_DEVICE_MOTION, + time, x, y, sx, sy); + break; + case WLSC_DEVICE_GRAB_MOVE: es = device->grab_surface; es->x = x + device->grab_dx; -- 2.7.4