diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2010-08-04 23:21:41 -0400 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2010-08-04 23:21:41 -0400 |
| commit | 5b75f1b218db312df0140b9f89d7c04649f554ce (patch) | |
| tree | 45e4a0a4ca3ac54bac04944097cc237c3c1f896e /compositor.c | |
| parent | Introduce 'shell' object for moving and resizing surfaces in the compositor (diff) | |
| download | wayland-5b75f1b218db312df0140b9f89d7c04649f554ce.tar wayland-5b75f1b218db312df0140b9f89d7c04649f554ce.tar.gz wayland-5b75f1b218db312df0140b9f89d7c04649f554ce.tar.bz2 wayland-5b75f1b218db312df0140b9f89d7c04649f554ce.tar.lz wayland-5b75f1b218db312df0140b9f89d7c04649f554ce.tar.xz wayland-5b75f1b218db312df0140b9f89d7c04649f554ce.tar.zst wayland-5b75f1b218db312df0140b9f89d7c04649f554ce.zip | |
Implement server side move override
Diffstat (limited to 'compositor.c')
| -rw-r--r-- | compositor.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/compositor.c b/compositor.c index 3af3566..da1a658 100644 --- a/compositor.c +++ b/compositor.c @@ -783,9 +783,15 @@ notify_button(struct wlsc_input_device *device, device->grab = WLSC_DEVICE_GRAB_NONE; } - wl_surface_post_event(&surface->base, &device->base, - WL_INPUT_DEVICE_BUTTON, - time, button, state); + if (state && button == BTN_LEFT && + device->grab == WLSC_DEVICE_GRAB_MOTION && + (device->modifier_state & MODIFIER_SUPER)) + shell_move(NULL, &compositor->shell, + &surface->base, device, time); + else + wl_surface_post_event(&surface->base, &device->base, + WL_INPUT_DEVICE_BUTTON, + time, button, state); wlsc_compositor_schedule_repaint(compositor); } @@ -795,11 +801,10 @@ void notify_key(struct wlsc_input_device *device, uint32_t time, uint32_t key, uint32_t state) { - struct wlsc_compositor *compositor = device->ec; uint32_t *k, *end; uint32_t modifier; - switch (key | compositor->modifier_state) { + switch (key | device->modifier_state) { case KEY_BACKSPACE | MODIFIER_CTRL | MODIFIER_ALT: kill(0, SIGTERM); return; @@ -816,15 +821,20 @@ notify_key(struct wlsc_input_device *device, modifier = MODIFIER_ALT; break; + case KEY_LEFTMETA: + case KEY_RIGHTMETA: + modifier = MODIFIER_SUPER; + break; + default: modifier = 0; break; } if (state) - compositor->modifier_state |= modifier; + device->modifier_state |= modifier; else - compositor->modifier_state &= ~modifier; + device->modifier_state &= ~modifier; end = device->keys.data + device->keys.size; for (k = device->keys.data; k < end; k++) { |
