aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
authorLibravatar Dudemanguy <random342@airmail.cc>2021-08-10 12:01:37 -0500
committerLibravatar Simon Ser <contact@emersion.fr>2021-08-12 10:02:17 +0200
commitacf946fe4c495b47c5a76230ba98f9b973bec96d (patch)
treeb73daeffd06e391527170d5117e1dc509c8e82b5 /sway/desktop/xdg_shell.c
parentDocument view_map (diff)
downloadsway-acf946fe4c495b47c5a76230ba98f9b973bec96d.tar.gz
sway-acf946fe4c495b47c5a76230ba98f9b973bec96d.tar.zst
sway-acf946fe4c495b47c5a76230ba98f9b973bec96d.zip
xdg-decoration: let floating clients set borders
The xdg-decoration protocol allows clients to request whether they want to use server side decorations or client side decorations. Currently, sway ignores this and always enforces whatever the server is currently set to. Although tiled clients cannot be allowed to set borders, there is no harm in listening requests from floating clients. Sidenote: also fix an unrelated style error.
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index d34654fd..1f70b193 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -443,12 +443,15 @@ static void handle_map(struct wl_listener *listener, void *data) {
443 443
444 bool csd = false; 444 bool csd = false;
445 445
446 if (!view->xdg_decoration) { 446 if (view->xdg_decoration) {
447 enum wlr_xdg_toplevel_decoration_v1_mode mode =
448 view->xdg_decoration->wlr_xdg_decoration->client_pending_mode;
449 csd = mode == WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE;
450 } else {
447 struct sway_server_decoration *deco = 451 struct sway_server_decoration *deco =
448 decoration_from_surface(xdg_surface->surface); 452 decoration_from_surface(xdg_surface->surface);
449 csd = !deco || deco->wlr_server_decoration->mode == 453 csd = !deco || deco->wlr_server_decoration->mode ==
450 WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT; 454 WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
451
452 } 455 }
453 456
454 view_map(view, view->wlr_xdg_surface->surface, 457 view_map(view, view->wlr_xdg_surface->surface,