From 2506d43bb9b78adbfa291604616363089b4dcc21 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 14 Jan 2024 09:27:00 +0400 Subject: xdg-decoration: Document SDL2 bug --- src/handlers/xdg_shell.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index cc3b7429..9df4274f 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -288,6 +288,14 @@ impl XdgDecorationHandler for State { } fn request_mode(&mut self, toplevel: ToplevelSurface, mode: zxdg_toplevel_decoration_v1::Mode) { + // Set whatever the client wants, rather than our preferred mode. This especially matters + // for SDL2 which has a bug where forcing a different (client-side) decoration mode during + // their window creation sequence would leave the window permanently hidden. + // + // https://github.com/libsdl-org/SDL/issues/8173 + // + // The bug has been fixed, but there's a ton of apps which will use the buggy version for a + // long while... toplevel.with_pending_state(|state| { state.decoration_mode = Some(mode); }); -- cgit