From 62123dc37e930d5d6265b4d4670e0a3cedccadda Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sun, 17 Oct 2021 17:12:51 +0000 Subject: [PATCH] xwayland: Implement resize event Signed-off-by: Joshua Ashton --- src/xwayland.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/xwayland.c b/src/xwayland.c index a32202f5..9fc60b95 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -43,6 +43,23 @@ handle_request_move(struct wl_listener *listener, void *data) interactive_begin(view, LAB_INPUT_STATE_MOVE, 0); } +static void +handle_request_resize(struct wl_listener *listener, void *data) +{ + /* + * This event is raised when a client would like to begin an interactive + * resize, 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 wlr_xwayland_resize_event *event = data; + struct view *view = wl_container_of(listener, view, request_resize); + interactive_begin(view, LAB_INPUT_STATE_RESIZE, event->edges); +} + static void handle_map(struct wl_listener *listener, void *data) { @@ -329,6 +346,9 @@ xwayland_surface_new(struct wl_listener *listener, void *data) view->request_move.notify = handle_request_move; wl_signal_add(&xsurface->events.request_move, &view->request_move); + view->request_resize.notify = handle_request_resize; + wl_signal_add(&xsurface->events.request_resize, + &view->request_resize); view->set_title.notify = handle_set_title; wl_signal_add(&xsurface->events.set_title, &view->set_title);