Add a touch move binding
When holding the compositor super key the touch events can now be used
to move a window.
diff --git a/src/shell.c b/src/shell.c
index 4a0c122..2822a2b 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2774,6 +2774,26 @@
}
static void
+touch_move_binding(struct weston_seat *seat, uint32_t time, void *data)
+{
+ struct weston_surface *focus =
+ (struct weston_surface *) seat->touch->focus;
+ struct weston_surface *surface;
+ struct shell_surface *shsurf;
+
+ surface = weston_surface_get_main_surface(focus);
+ if (surface == NULL)
+ return;
+
+ shsurf = get_shell_surface(surface);
+ if (shsurf == NULL || shsurf->type == SHELL_SURFACE_FULLSCREEN ||
+ shsurf->type == SHELL_SURFACE_MAXIMIZED)
+ return;
+
+ surface_touch_move(shsurf, (struct weston_seat *) seat);
+}
+
+static void
resize_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *data)
{
struct weston_surface *focus =
@@ -4531,6 +4551,7 @@
zoom_key_binding, NULL);
weston_compositor_add_button_binding(ec, BTN_LEFT, mod, move_binding,
shell);
+ weston_compositor_add_touch_binding(ec, mod, touch_move_binding, shell);
weston_compositor_add_button_binding(ec, BTN_MIDDLE, mod,
resize_binding, shell);