aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2021-08-10 12:01:37 -0500
committerSimon Ser <contact@emersion.fr>2021-08-12 10:02:17 +0200
commitacf946fe4c495b47c5a76230ba98f9b973bec96d (patch)
treeb73daeffd06e391527170d5117e1dc509c8e82b5 /sway/desktop
parent7a15e715b7c5c91b12f82b3e94230b6644d3893d (diff)
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')
-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) {
bool csd = false;
- if (!view->xdg_decoration) {
+ if (view->xdg_decoration) {
+ enum wlr_xdg_toplevel_decoration_v1_mode mode =
+ view->xdg_decoration->wlr_xdg_decoration->client_pending_mode;
+ csd = mode == WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE;
+ } else {
struct sway_server_decoration *deco =
decoration_from_surface(xdg_surface->surface);
csd = !deco || deco->wlr_server_decoration->mode ==
WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
-
}
view_map(view, view->wlr_xdg_surface->surface,