wxSplashScreen shows titlebar on Wayland compositors that prefer server-side decorations (Issue #26357)

16 views
Skip to first unread message

akelmanson

unread,
Apr 7, 2026, 9:48:04 AM (3 days ago) Apr 7
to wx-...@googlegroups.com, Subscribed
akelmanson created an issue (wxWidgets/wxWidgets#26357)

Description

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.

Steps to reproduce

  1. Create a wxSplashScreen with wxBORDER_NONE style
  2. Run on a Wayland session with a compositor that prefers SSD (e.g., Sway, Cosmic DE)
  3. Observe: the splash screen has a compositor-drawn titlebar

Expected behavior

Splash screen should appear as a borderless, undecorated floating window — identical to X11 behavior.

Platform

  • wxWidgets 3.3.2 (wxGTK3)
  • Tested on: Sway (wlroots), Cosmic DE (smithay)
  • Does not reproduce on GNOME (Mutter uses CSD-only)
  • Does not reproduce on X11

Proposed fix

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;

Note

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.Message ID: <wxWidgets/wxWidgets/issues/26357@github.com>

VZ

unread,
Apr 7, 2026, 10:09:10 AM (3 days ago) Apr 7
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26357)

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.Message ID: <wxWidgets/wxWidgets/issues/26357/4199586169@github.com>

paulcor

unread,
Apr 7, 2026, 11:53:19 AM (3 days ago) Apr 7
to wx-...@googlegroups.com, Subscribed
paulcor left a comment (wxWidgets/wxWidgets#26357)

@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.Message ID: <wxWidgets/wxWidgets/issues/26357/4200367716@github.com>

akelmanson

unread,
Apr 7, 2026, 12:46:31 PM (3 days ago) Apr 7
to wx-...@googlegroups.com, Subscribed
akelmanson left a comment (wxWidgets/wxWidgets#26357)

@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.Message ID: <wxWidgets/wxWidgets/issues/26357/4200728828@github.com>

paulcor

unread,
Apr 7, 2026, 2:09:55 PM (3 days ago) Apr 7
to wx-...@googlegroups.com, Subscribed

Closed #26357 as completed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/26357/issue_event/24268777806@github.com>

Reply all
Reply to author
Forward
0 new messages