Bug 417957 - Gtk csd windows: Can't access menu on icon click
Summary: Gtk csd windows: Can't access menu on icon click
Status: RESOLVED INTENTIONAL
Alias: None
Product: Breeze
Classification: Plasma
Component: gtk theme (show other bugs)
Version: 5.18.1
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Janet Blackquill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-20 22:52 UTC by Gabriel Fernandes
Modified: 2020-02-24 21:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Menu that should appear on icon click (16.92 KB, image/png)
2020-02-20 22:52 UTC, Gabriel Fernandes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Fernandes 2020-02-20 22:52:35 UTC
Created attachment 126236 [details]
Menu that should appear on icon click

SUMMARY
It is not possible to access additional gtk menu on csd applications, this is a big issue
because you have no way to access the preferences of the application, about and keyboard  shortcuts windows, etc
Even if you edit the file manually to solve the problem, after reboot the system updates again the file, back to the
bad configuration that leaves you unable to access the menu

STEPS TO REPRODUCE
1. Open a Gtk client side decoration window like gnome calc
2. Try to open the menu clicking on the window icon
3. Menu won't open, clicking in the icon

OBSERVED RESULT
Not possible to access menu

EXPECTED RESULT
Be possible to access menu

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.18
KDE Plasma Version: 5.18.1
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Kernel Version: 5.3.0-40-generic

ADDITIONAL INFORMATION (How to fix)
To fix this issue instead of (in ~/.config/gtk-3.0/settings.ini):
gtk-decoration-layout=icon:minimize,maximize,close
should be (menu instead of icon):
gtk-decoration-layout=menu:minimize,maximize,close
Comment 1 Nate Graham 2020-02-22 17:08:44 UTC
Based on your screenshot, it looks like you're forcing server-side decorations on these apps, not using their native client-side decorations. Can you confirm?
Comment 2 Gabriel Fernandes 2020-02-22 17:58:51 UTC
No, the only change I made was to put
gtk-decoration-layout=menu:minimize,maximize,close
in ~/.config/gtk-3.0/settings.ini
instead of
gtk-decoration-layout=icon:minimize,maximize,close

This file seems to be written automatically by plasma on login, so if you edit it manually you lose your editions on login, so you can't even workaround the problem (unless you set the folder to read-only, so plasma can't reset your modifications to workaround the issue)

This gtk configuration is like the plasma's titlebar buttons rearrange in "Aplication Style" > "Window decorations" > "Titlebar Buttons", but for gtk client-side (csd) apps.
So the default (on plasma 5.18) is to put icon instead of menu on that file (settings.ini) gtk-decoration-layout. I think last version (5.17) we could access the menu on gtk csd apps, but not now on 5.18.

I believe the fix for this issue is just finding the piece of code that writes that file (settings.ini) and instead of ...icon... change to ...menu...
(the icon still appears it's just that if you click the icon the menu appears, but not with just icon instead of menu)

Here you see this menu in nautilus that let's you access the app's preferences
https://imgur.com/a/M8FPE7C
The way it's right now you cannot access this menu, so you lose many of the gtk apps, which uses csd, features
Comment 3 Mikhail Zolotukhin 2020-02-24 17:01:29 UTC
GTK appmenu is deprecated. See https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/App-Menu-Retirement and the beginning of https://developer.gnome.org/ApplicationMenu/

Therefore Plasma does not support them. To fix the issue on the distribution, where applications from repositories are too old, please install new versions of GTK applications via flatpak or ppa (in case of Ubuntu based distros). If new version of application still contains the appmenu, please report to the application authors.
Comment 4 Gabriel Fernandes 2020-02-24 18:51:49 UTC
Sorry, but this makes no sense.

The deprecation of GTK appmenu is meant to people who are developing applications to not use them anymore, and to port their app menu to the the window itself.
This seems to be fairly recent, even after Ubuntu 18.04, as the applications in the repository of Ubuntu 18.04 still put important functionality in the appmenu.
This basically kills many applications from the still supported repositories.

Why kill applications from the repository and force users to find other means to install these applications if a simple change in the default settings.ini that plasma writes solves the problem?

For the record, even to make gnome calculator from flatpak use Breeze theme is a pain, the application even displays no icon in the kickoff menu, and wrong icon in the task manager.
https://imgur.com/a/Vmo5Rvg

If it doens't break the newer versions, but breaks the still supported versions, why just break the supported versions anyway?
Comment 5 Mikhail Zolotukhin 2020-02-24 19:36:54 UTC
> Why kill applications from the repository and force users to find other
> means to install these applications if a simple change in the default
> settings.ini that plasma writes solves the problem?

If you think, that change is simple, please provide a patch, that solves the problem. 

Btw, to style gtk flatpak apps under Plasma > 5.18 install xsettingsd package.
Comment 6 Gabriel Fernandes 2020-02-24 20:58:57 UTC
Here:
https://cgit.kde.org/kde-gtk-config.git/tree/kded/configvalueprovider.cpp?h=v5.18.0#n206

line 206, changing the string "icon," to "menu," I believe should solve it
Comment 7 Nate Graham 2020-02-24 21:09:18 UTC
(In reply to Gabriel Fernandes from comment #4)
> This seems to be fairly recent

> applications in the repository of Ubuntu 18.04
FWIW, Ubuntu 18.04 is almost two years old, not what I would call "fairly recent." :)

However if there's a way to improve this without causing regressions or worsening the user experience for newer CSD-using GTK apps that do comply with GNOME's HIG, I think we'd be open to it.
Comment 8 Mikhail Zolotukhin 2020-02-24 21:16:05 UTC
The issue is happening because neon packaging. I beleive in other distros GNOME apps are fairly new and does not have an appmenu.

(In reply to Gabriel Fernandes from comment #6)
> Here:
> https://cgit.kde.org/kde-gtk-config.git/tree/kded/configvalueprovider.
> cpp?h=v5.18.0#n206
> 
> line 206, changing the string "icon," to "menu," I believe should solve it

If you change that, the apps, that do not have an appmenu, will lose an icon in titlebar. If everyone is ok with that, I am ok too.
Comment 9 Gabriel Fernandes 2020-02-24 21:30:01 UTC
Ubuntu's new LTS 20.04 release date is April 23, 2020, at least two months till there. Neon User Edition is still using 18.04 as base, so we got all of the goodies of KDE 5.18, but unfortunately the 5.18's update disabled the access to the menu.

This may not be a problem for distros that receive faster updates like Arch, as gtk applications also got updated in the meantime.
But for the Ubuntu side, especially Neon, it simply broke many important applications. Until Neon change its base to 20.04, maybe in some months?.