From 7b138e5ef0f679c9bb0078019d7c9c63fef36273 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 24 Sep 2018 20:54:57 +1000 Subject: Add CSD to border modes This replaces view.using_csd with a new border mode: B_CSD. This also removes sway_xdg_shell{_v6}_view.deco_mode and view->has_client_side_decorations as we can now get these from the border. You can use `border toggle` to cycle through the modes including CSD, or use `border csd` to set it directly. The client must support the xdg-decoration protocol, and the only client I know of that does is the example in wlroots. If the client switches from SSD to CSD without us expecting it (via the server-decoration protocol), we stash the previous border type into view.saved_border so we can restore it if the client returns to SSD. I haven't found a way to test this though. --- sway/server.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sway/server.c') diff --git a/sway/server.c b/sway/server.c index bed5aed1..63bfa7e1 100644 --- a/sway/server.c +++ b/sway/server.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include "list.h" @@ -115,6 +116,14 @@ bool server_init(struct sway_server *server) { server->server_decoration.notify = handle_server_decoration; wl_list_init(&server->decorations); + server->xdg_decoration_manager = + wlr_xdg_decoration_manager_v1_create(server->wl_display); + wl_signal_add( + &server->xdg_decoration_manager->events.new_toplevel_decoration, + &server->xdg_decoration); + server->xdg_decoration.notify = handle_xdg_decoration; + wl_list_init(&server->xdg_decorations); + wlr_export_dmabuf_manager_v1_create(server->wl_display); wlr_screencopy_manager_v1_create(server->wl_display); -- cgit v1.2.3-54-g00ecf