diff --git a/src/xwayland.c b/src/xwayland.c index bd9966f6..a32202f5 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -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);