]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: Implement move event
authorJoshua Ashton <joshua@froggi.es>
Sun, 17 Oct 2021 17:11:41 +0000 (17:11 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 17 Oct 2021 17:23:15 +0000 (18:23 +0100)
Closes: #81
Signed-off-by: Joshua Ashton <joshua@froggi.es>
src/xwayland.c

index bd9966f66fb1df08c3c1d615901c752097cb2a3f..a32202f50700a30a3dda7782f193a6939ec255be 100644 (file)
@@ -27,6 +27,22 @@ handle_commit(struct wl_listener *listener, void *data)
        damage_view_whole(view);
 }
 
+static void
+handle_request_move(struct wl_listener *listener, void *data)
+{
+       /*
+        * This event is raised when a client would like to begin an interactive
+        * move, typically because the user clicked on their client-side
+        * decorations. Note that a more sophisticated compositor should check
+        * the provied serial against a list of button press serials sent to
+        * this
+        * client, to prevent the client from requesting this whenever they
+        * want.
+        */
+       struct view *view = wl_container_of(listener, view, request_move);
+       interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
+}
+
 static void
 handle_map(struct wl_listener *listener, void *data)
 {
@@ -310,6 +326,9 @@ xwayland_surface_new(struct wl_listener *listener, void *data)
        view->request_fullscreen.notify = handle_request_fullscreen;
        wl_signal_add(&xsurface->events.request_fullscreen,
                &view->request_fullscreen);
+       view->request_move.notify = handle_request_move;
+       wl_signal_add(&xsurface->events.request_move,
+               &view->request_move);
 
        view->set_title.notify = handle_set_title;
        wl_signal_add(&xsurface->events.set_title, &view->set_title);