Better fix for CSD toggling on Wayland

Draw CSD if the compositor wants us to. See #3888
This commit is contained in:
Kovid Goyal 2021-07-31 14:15:38 +05:30
parent 68cd863fe0
commit 80cebdefcd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

10
glfw/wl_window.c vendored
View File

@ -264,14 +264,10 @@ xdgDecorationHandleConfigure(void* data,
bool has_server_side_decorations = (mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
debug("XDG decoration configure event received: Has server side decorations: %d\n", has_server_side_decorations);
if (!has_server_side_decorations && window->wl.decorations.serverSide) {
// this can happen for example on sway where it has a "border toggle" function
// that turns on/off the server side decorations. In such a case, we dont turn
// on client side decorations, as that causes things to break.
return;
}
if (has_server_side_decorations == window->wl.decorations.serverSide) return;
window->wl.decorations.serverSide = has_server_side_decorations;
ensure_csd_resources(window);
if (window->wl.decorations.serverSide) free_csd_surfaces(window);
else ensure_csd_resources(window);
}
static const struct zxdg_toplevel_decoration_v1_listener xdgDecorationListener = {