From 236e5c2451fa8ddca85f9bdf8778c5c38d0083a2 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 7 Apr 2026 08:45:19 -0700 Subject: [PATCH] Fix for titlebar showing on Wayland with wxBORDER_NONE and server-side decorations Removing decorations with gtk_window_set_decorated() is insufficient to disable titlebar with some Wayland compositors. See #26357 --- src/gtk/toplevel.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index cab53d7105..00ebc2ebf5 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -899,14 +899,6 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, if ( style & wxCAPTION ) m_gdkDecor |= GDK_DECOR_TITLE; -#if GTK_CHECK_VERSION(3,10,0) - else if ( - wxGTKImpl::IsWayland(display) && - gtk_check_version(3,10,0) == nullptr) - { - gtk_window_set_titlebar(GTK_WINDOW(m_widget), gtk_header_bar_new()); - } -#endif if ( style & wxSYSTEM_MENU ) m_gdkDecor |= GDK_DECOR_MENU; @@ -923,6 +915,14 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, m_gdkDecor |= GDK_DECOR_RESIZEH; } } +#if GTK_CHECK_VERSION(3,10,0) + if ((m_gdkDecor & GDK_DECOR_TITLE) == 0 && + wxGTKImpl::IsWayland(display) && + wx_is_at_least_gtk3(10)) + { + gtk_window_set_titlebar(GTK_WINDOW(m_widget), gtk_header_bar_new()); + } +#endif m_decorSize = GetCachedDecorSize();