From bad8a87f4c66638a1ffd1b0bf39e9788a3e59ed3 Mon Sep 17 00:00:00 2001 From: Ryan Walklin Date: Fri, 12 Dec 2025 16:51:20 +1300 Subject: [PATCH] server: add xdg-toplevel-drag-v1 manager Add the xdg-toplevel-drag-v1 protocol manager to the server. This protocol allows clients to attach a toplevel window to an ongoing drag-and-drop operation, enabling features like browser tab tear-off. --- include/sway/server.h | 2 ++ sway/server.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/sway/server.h b/include/sway/server.h index f50d48f05..51ab28a15 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -123,6 +123,8 @@ struct sway_server { struct wl_listener request_set_cursor_shape; + struct wlr_xdg_toplevel_drag_manager_v1 *xdg_toplevel_drag_manager; + struct wlr_tearing_control_manager_v1 *tearing_control_v1; struct wl_listener tearing_control_new_object; struct wl_list tearing_controllers; // sway_tearing_controller::link diff --git a/sway/server.c b/sway/server.c index 7f399a2bb..473671cf8 100644 --- a/sway/server.c +++ b/sway/server.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include "config.h" @@ -450,6 +451,9 @@ bool server_init(struct sway_server *server) { wl_signal_add(&xdg_toplevel_tag_manager_v1->events.set_tag, &server->xdg_toplevel_tag_manager_v1_set_tag); + server->xdg_toplevel_drag_manager = + wlr_xdg_toplevel_drag_manager_v1_create(server->wl_display, 1); + struct wlr_cursor_shape_manager_v1 *cursor_shape_manager = wlr_cursor_shape_manager_v1_create(server->wl_display, 1); server->request_set_cursor_shape.notify = handle_request_set_cursor_shape;