Bug 418385

Summary: Global Menu doesn't work properly with Mediainfo GUI
Product: [Plasma] plasmashell Reporter: Yevhen Popok <xalt7x.service>
Component: gmenu-dbusmenu-proxyAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED FIXED    
Severity: normal CC: plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.18.1   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.18.3
Sentry Crash Report:
Attachments: All "View" modes are visually "selected"

Description Yevhen Popok 2020-03-02 06:50:04 UTC
Created attachment 126541 [details]
All "View" modes are visually "selected"

SUMMARY
With Global Menu enabled it's impossible to switch between "View" modes in Mediainfo GUI

STEPS TO REPRODUCE
1. Install mediainfo-gui
2. Enable Global Menu (panel widget or decoration button) 
3. Launch Mediainfo GUI
4. Try to change mode into "View" menu

OBSERVED RESULT
Visually all radio-buttons enabled and you can't really select one of them.

EXPECTED RESULT
Mode changes if you press appropriate radio-button

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 20.04
KDE Plasma Version: 5.18.2
KDE Frameworks Version: 5.67.0
Qt Version: 5.12.5

ADDITIONAL INFORMATION
Mediainfo GUI uses wxWidgets + GTK3. I also tried it on XFCE (Xubuntu with xfce4-appmenu-plugin) and it works there.
Comment 1 Kai Uwe Broulik 2020-03-06 08:45:38 UTC
There's two bugs in the radio button handling. All apps I tested the proxy with used separate actions for all radio options, e.g. zoom-100, zoom-200, etc.
Mediainfo-gui uses a single action and then changes its state.

We fail to:
- Pass the "target" with the action breaking action invocation
- Properly update multiple menu items referring to the same action
Comment 2 Kai Uwe Broulik 2020-03-06 09:15:32 UTC
Patches:
https://phabricator.kde.org/D27884 for invocation
https://phabricator.kde.org/D27885 for correctly showing checked state
Comment 3 Kai Uwe Broulik 2020-03-09 08:22:45 UTC
Git commit 503bf4f3a54267e22592c3e0ee246c20a2485a3d by Kai Uwe Broulik.
Committed on 09/03/2020 at 08:21.
Pushed by broulik into branch 'Plasma/5.18'.

[gmenu-dbusmenu-proxy] Pass action "target" in invocation

According to documentation [1] a menu item has a target attribute, which is "the parameter to pass when activating the action".
Furthermore, the action "Activate" method specifies "If the action activation requires a parameter then this parameter must
be given in the second parameter (av).". Also implements a TODO in the code.

[1] https://wiki.gnome.org/Projects/GLib/GApplication/DBusAPI

Differential Revision: https://phabricator.kde.org/D27884

M  +7    -3    gmenu-dbusmenu-proxy/actions.cpp
M  +1    -1    gmenu-dbusmenu-proxy/actions.h
M  +6    -5    gmenu-dbusmenu-proxy/window.cpp
M  +1    -1    gmenu-dbusmenu-proxy/window.h

https://commits.kde.org/plasma-workspace/503bf4f3a54267e22592c3e0ee246c20a2485a3d
Comment 4 Kai Uwe Broulik 2020-03-09 08:22:45 UTC
Git commit ea358c896668a5c74ed8c405358c919e94adc8d7 by Kai Uwe Broulik.
Committed on 09/03/2020 at 08:21.
Pushed by broulik into branch 'Plasma/5.18'.

[gmenu-dbusmenu-proxy] Fix radio button state detection

Instead of comparing the state of the action to the action name, compare it to the argument the action will invoke it with.
In contrast to checkboxes, which are independent actions with a boolean state, radio menu items all refer
to the same action (e.g. "Zoom") and then pass the new state ("zoom-100", "zoom-200", etc) as target when invoking the action.

Differential Revision: https://phabricator.kde.org/D27885

M  +9    -12   gmenu-dbusmenu-proxy/window.cpp

https://commits.kde.org/plasma-workspace/ea358c896668a5c74ed8c405358c919e94adc8d7