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.
This commit is contained in:
Dudemanguy 2021-08-10 12:01:37 -05:00 committed by Simon Ser
parent 7a15e715b7
commit acf946fe4c
3 changed files with 43 additions and 4 deletions

View file

@ -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,