wxSplashScreen created with wxBORDER_NONE (or wxSIMPLE_BORDER) displays a window titlebar on Wayland compositors that prefer server-side decorations (SSD) via the xdg-decoration protocol.
The existing code in src/gtk/toplevel.cpp correctly calls gtk_window_set_decorated(GTK_WINDOW(m_widget), false) when wxNO_BORDER is in the style flags. However, this only removes client-side decorations (CSD). Wayland compositors that default to SSD — such as Sway (wlroots), Cosmic (smithay), Hyprland, and others — still add their own titlebar because the client never explicitly opted into CSD mode via the xdg-decoration negotiation.
wxSplashScreen with wxBORDER_NONE styleSplash screen should appear as a borderless, undecorated floating window — identical to X11 behavior.
Before the window is realized, set an empty GtkFixed widget as the titlebar via gtk_window_set_titlebar(). This forces GTK to request CSD mode from the compositor via xdg-decoration, after which gtk_window_set_decorated(false) removes the CSD titlebar entirely. Net result: zero decorations on all compositors.
diff --git a/src/generic/splash.cpp b/src/generic/splash.cpp index 2e55a6e..a8150de 100644 --- a/src/generic/splash.cpp +++ b/src/generic/splash.cpp @@ -64,6 +64,19 @@ wxSplashScreen::wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int mil #if defined(__WXGTK__) gtk_window_set_type_hint(GTK_WINDOW(m_widget), GDK_WINDOW_TYPE_HINT_SPLASHSCREEN); + // On Wayland, compositors that prefer server-side decorations (SSD) + // via the xdg-decoration protocol may add a titlebar even when + // gtk_window_set_decorated(false) was called (which only removes CSD). + // Setting a custom titlebar widget forces GTK to request client-side + // decoration mode from the compositor, then set_decorated(false) + // removes the CSD titlebar entirely. + if (style & (wxSIMPLE_BORDER | wxNO_BORDER)) + { + GtkWidget *empty = gtk_fixed_new(); + gtk_widget_set_size_request(empty, 0, 0); + gtk_window_set_titlebar(GTK_WINDOW(m_widget), empty); + gtk_window_set_decorated(GTK_WINDOW(m_widget), false); + } #endif m_splashStyle = splashStyle;
This issue likely affects any wxFrame created with wxNO_BORDER on Wayland with SSD-preferring compositors, not just wxSplashScreen. The fix in src/gtk/toplevel.cpp (where gtk_window_set_decorated is called for wxNO_BORDER) might be the better location for a general fix. The splash.cpp patch above is a minimal targeted fix.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks for the report and the fix suggestion! This very much looks like a hack, but if it works, I think we should do it — and, indeed, do it at wxFrame level.
@paulcor Would you have any comments about this?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@akelmanson Can you check that #26359 fixes the issue for you?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@paulcor Confirmed — #26359 fixes the issue. Tested on Cosmic DE (smithay) and Sway (wlroots), splash screen now renders borderless on both. X11 unaffected.
Thanks for the quick fix!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()