wxGTK 3.2.8: title bar shows minimization and maximization buttons on GNOME/wayland (Issue #25562)

29 views
Skip to first unread message

Pacho Ramos

unread,
Jun 24, 2025, 9:20:06 AM6/24/25
to wx-...@googlegroups.com, Subscribed
pacho2 created an issue (wxWidgets/wxWidgets#25562)

Hello,

While running on X, wxGTK based apps properly show only the close botton on GNOME, switching to wayland makes them show minimize and maximize buttons also. At first I thought that it was a Gentoo issue, but I have just tested with Filezilla on a Fedora 42 live cd, and it's the same. It affects to all the wxGTK apps I have tried (openbabel, amule, filezilla).

Thanks a lot for your help


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/25562@github.com>

VZ

unread,
Jun 24, 2025, 9:21:57 AM6/24/25
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25562)

Err, minimize/maximize buttons are shown by default. Why do you think they should not be shown?


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/25562/3000472819@github.com>

Pacho Ramos

unread,
Jun 24, 2025, 9:46:45 AM6/24/25
to wx-...@googlegroups.com, Subscribed
pacho2 left a comment (wxWidgets/wxWidgets#25562)

Since Gnome3 times (I don't remember the exact release, but it was many years ago), gnome-shell only relies on the "close" button by default. I think only on Ubuntu are they reactivating the other buttons by toggling /org/gnome/desktop/wm/preferences/button-layout dconf setting, but in most of the other distributions (using upstream GNOME), only the close button is shown.

That is the reason some people teach others about how to configure it:
https://gitlab.gnome.org/Teams/Design/whiteboards/-/issues/87
https://fostips.com/enable-minimize-maximize-fedora-gnome-40/

That is honored by GTK and QT apps... also works for wxGTK ones running on X11... but it seems that on wayland, they go back to adding those buttons.


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/25562/3000566703@github.com>

Pacho Ramos

unread,
Jun 24, 2025, 9:49:31 AM6/24/25
to wx-...@googlegroups.com, Subscribed
pacho2 left a comment (wxWidgets/wxWidgets#25562)

Looking into into src/gtk/toplevel.cpp, it seems that the honoring of button-layout setting is being skipped for "client side decorations" setups (-> wayland), but I don't know why :/

#if GTK_CHECK_VERSION(3,12,0)
            if (m_gdkDecor && wx_is_at_least_gtk3(12))
            {
                char layout[sizeof("icon,menu:minimize,maximize,close")];
                snprintf(layout, sizeof(layout), "icon%s:%s%s%s",
                     m_gdkDecor & GDK_DECOR_MENU ? ",menu" : "",
                     m_gdkDecor & GDK_DECOR_MINIMIZE ? "minimize," : "",
                     m_gdkDecor & GDK_DECOR_MAXIMIZE ? "maximize," : "",
                     m_gdkFunc & GDK_FUNC_CLOSE ? "close" : "");
                gtk_header_bar_set_decoration_layout(GTK_HEADER_BAR(titlebar), layout);
            }
#endif // 3.12
            // Don't set WM decorations when GTK is using Client Side Decorations
            m_gdkDecor = 0;
        }
    }
#endif // 3.10


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/25562/3000578655@github.com>

VZ

unread,
Jun 24, 2025, 10:51:07 AM6/24/25
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25562)

GTK applications now use the header bar which is different from CSD, so I don't find it that shocking that wx applications show the buttons that GTK ones do not — wx ones don't have the menu button in the title bar, so they have more space for them.

But I guess it would be better to make the title bar less useful but more similar to the native apps... This would be simple to do, too, we just need to ignore GDK_DECOR_MINIMIZE and GDK_DECOR_MAXIMIZE in the code above, i.e. the following

diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp
index 170da13769..0dc0e362af 100644
--- a/src/gtk/toplevel.cpp
+++ b/src/gtk/toplevel.cpp
@@ -414,6 +414,8 @@ void wxTopLevelWindowGTK::GTKHandleRealized()
 #if GTK_CHECK_VERSION(3,12,0)
             if (m_gdkDecor && wx_is_at_least_gtk3(12))
             {
+                m_gdkDecor &= ~(GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE);
+
                 char layout[sizeof("icon,menu:minimize,maximize,close")];
                 snprintf(layout, sizeof(layout), "icon%s:%s%s%s",
                      m_gdkDecor & GDK_DECOR_MENU ? ",menu" : "",

"fixes" the problem. @paulcor Should we do this (not in this exact form, of course)?


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/25562/3000823477@github.com>

VZ

unread,
Jun 26, 2025, 6:51:13 AM6/26/25
to wx-...@googlegroups.com, Subscribed

Closed #25562 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/25562/issue_event/18333975994@github.com>

VZ

unread,
Jun 26, 2025, 6:51:17 AM6/26/25
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25562)

Thanks for fixing this, Paul! I think this can be closed, and I'll backport this to 3.2 too.

@pacho2 Please let us know if you still see any problems after the fix above.


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/25562/3008055784@github.com>

Pacho Ramos

unread,
Jun 28, 2025, 7:34:14 AM6/28/25
to wx-...@googlegroups.com, Subscribed
pacho2 left a comment (wxWidgets/wxWidgets#25562)

I applied it to 3.2.8.1 and it fixes the issue :D Thanks a lot

Regarding a future 3.2.x release, do you know when it would be released? (to know if we try to apply the patch downstream on Gentoo right now or we can simply wait a bit for the next release including it)

Best regards


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/25562/3015197484@github.com>

VZ

unread,
Jun 28, 2025, 8:32:37 AM6/28/25
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25562)

We don't have any fixed date for 3.2.9 yet, normally I'd say September-October, but it could be sooner if any really bad bugs are discovered or later if life happens...


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/25562/3015223878@github.com>

Reply all
Reply to author
Forward
0 new messages