Cannot access GTK3 application menus on Wayland
Even though this feature has been deprecated since GNOME 3.34, GTK3 applications can still set up an “application menu” which, by default, will be shown as a button on the left of the application's title bar (when using Wayland) or as an extra “Application” menu in the application's menu bar (when using Xorg). Below is a screenshot of
gtk3-demo-application (which is part of the
gtk-3-examples package) showing such an application menu, with the button in the title bar; the screenshot was taken on a up-to-date, vanilla Debian 11 (bullseye) running the GNOME desktop environment:
However, since the switch to Wayland, this application menu is not accessible anymore, as can be seen in the following screenshot of the same application running on Tails 5.8:
In order to reproduce:
- Boot Tails 5.8.
- Install any application which has an application menu (such as the
- Start this application: the application menu is nowhere to be seen and cannot be accessed.
- Compare with running the same application
- on Debian 11: the button for the application menu will appear in the title bar of the application; or
- on Tails 5.7: an extra “Application” menu appears in the menu bar, an it contains the application menu.
This seems to be due to the fact that the
appmenu title-bar button has been disabled in Tails since 133e6bf1 (which was a fix for #11270 (closed)). Indeed, the default value for the
/org/gnome/desktop/wm/preferences/button-layout setting is
'appmenu:close', according to the corresponding GSettings schema, but, in order to add the “minimize” and “maximize” title-bar buttons, 133e6bf1 set this setting to
':minimize,maximize,close', which thus disabled the
This went unnoticed until then, as Tails still used the Xorg backend (which made the application menu appear as the extra “Application” menu in the menu bar). However, with the switch to Wayland, a few GTK3 applications are now missing their application menu. As far as I could find, this doesn't concern officially Tails-supported applications, but it still impacts other applications which can be installed through the official Debian repositories (such as Gobby, for instance).
From what I could test, it seems that setting
'appmenu:minimize,maximize,close' (using either
gsettings) fixes the problem and restores the application menu button in the title bar. Furthermore, I could check on an up-to-date, freshly installed Debian 11 that using
gnome-tweaks to enable the “minimize” and “maximize” title-bar buttons would set this setting to the same value.
I'll try and submit a simple fix along these lines.
Thank you very much!