xwayland: Implement move event

Closes: #81
Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-10-17 17:11:41 +00:00 committed by Johan Malm
parent a67e74670b
commit 2a18899689

View 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);