diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2010-08-17 13:14:24 -0400 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2010-08-17 13:14:24 -0400 |
| commit | 225a1768822761af1caa2a73b703822d7ad2db5e (patch) | |
| tree | dfe602c3a238f0917c5748e90472bfed52225bd9 /compositor.c | |
| parent | Insert unexplainable cairo_device_flush() to fix terminal drawing (diff) | |
| download | wayland-225a1768822761af1caa2a73b703822d7ad2db5e.tar wayland-225a1768822761af1caa2a73b703822d7ad2db5e.tar.gz wayland-225a1768822761af1caa2a73b703822d7ad2db5e.tar.bz2 wayland-225a1768822761af1caa2a73b703822d7ad2db5e.tar.lz wayland-225a1768822761af1caa2a73b703822d7ad2db5e.tar.xz wayland-225a1768822761af1caa2a73b703822d7ad2db5e.tar.zst wayland-225a1768822761af1caa2a73b703822d7ad2db5e.zip | |
Split GRAB_MOTION and GRAB_MOVE handling
Diffstat (limited to 'compositor.c')
| -rw-r--r-- | compositor.c | 17 |
1 files 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; |
