Bug 438467 - On button factor, the whole menu autocloses when circulating though first-level menu items, and second-onward levels show at the center of the screen
Summary: On button factor, the whole menu autocloses when circulating though first-lev...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Unclassified
Component: Global Menu (show other bugs)
Version: 5.22.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-11 12:47 UTC by acidrums4
Modified: 2022-04-05 14:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description acidrums4 2021-06-11 12:47:32 UTC
SUMMARY
I find this rather difficult to explain in plain text and can't record the screen because wayland, so I'd do my best.

Setting globalmenu in button factor (where it shows itself as a three-bar icon, you click it and the app menu appears) don't work as expected with Wayland. You can move your cursor through the elements of the first level menu (i.e. File, Edit, Preferences...). The second you move the cursor from one menu item to other, the menu autocloses itself, so you have to click the globalmenu button again and go to the desired menu item, being careful enough to not hover over any other menu item.

Also, the second-level popup menu (say, for example, the menu items contained by the 'File' menu) shows at the absolute center of the screen. There's a obscure pattern there too, because if you move the cursor in some direction the whole menu will autoclose, but in other way it does not - can't explain how, because I'm not quite sure of how that pattern works.

Weird enough, globalmenu works as expected when clicking the globalmenu item and activating the menu items with the keyboard (with cursor keys) or *almost* as expected when setting a global keyboard shortcut for it and activating it via keyboard. Second-onward level menus appear where they're supposed to show up, right next to the first level menu, but when setting a global keyboard shortcut and activating globalmenu with it, sometimes the first level menu will show up with a weird layout where the items show up with center-aligned texts and are not activatable/hoverable.

STEPS TO REPRODUCE
1. Add globalmenu to a panel, whether horizontal or vertical, and set it to button factor.
2. Open an app that has appmenu support (say, Dolphin).
3. Click the globalmenu button created in the panel.
4. Hover over a menu item and, if said menu item has a secondary menu, move the cursor to it.
5. Hover over several menu items on the first level.

OBSERVED RESULT
If (4) has a secondary menu, it will show at the absolute center of the screen. Trying to reach it with the cursor is difficult - if you move the cursor a certain way, the whole menu will close automatically.

On (5) the whole menu closes automatically, not letting the user to walk through the secondary items of a menu - you'd need to click globalmenu again, and carefully place the cursor over the desired menu item without hovering over any other item, or the whole menu will close automatically again.

EXPECTED RESULT
The user can walk through the items of any given menu without needing to activate globalmenu for each menu item, and secondary-onwards levels should show up right next to their parent. As traditional menus do.

SOFTWARE/OS VERSIONS
Linux: Gentoo x86-64, Kernel 5.12
KDE Plasma Version: 5.22
KDE Frameworks Version: 5.82
Qt Version: 5.15.2
Comment 1 Bug Janitor Service 2021-06-15 12:41:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/932
Comment 2 acidrums4 2022-02-12 15:26:03 UTC
Just wanted to add that recently tried the patch proposed in the mentioned merge request, and now globalmenu it's working as expected. Hope to see the final fix in the main branch soon.
Comment 3 Nate Graham 2022-04-05 14:53:40 UTC
Git commit 16ae8b9e69955dadab22b381963c69e2c55a9b3d by Nate Graham, on behalf of David Redondo.
Committed on 05/04/2022 at 14:30.
Pushed by nalvarez into branch 'master'.

appmenu: Use existing menu in compact represenation

There's no need to reconstruct the entire menu, when it exists already.
Also shows correct behavior on Wayland because the imported menues have
correct parents compared to the new  one.

M  +3    -7    applets/appmenu/lib/appmenuapplet.cpp
M  +10   -2    applets/appmenu/plugin/appmenumodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/16ae8b9e69955dadab22b381963c69e2c55a9b3d
Comment 4 Nate Graham 2022-04-05 14:56:50 UTC
Git commit e86c687d69b5058ce9f8f53ec904451df85e77d6 by Nate Graham, on behalf of David Redondo.
Committed on 05/04/2022 at 14:56.
Pushed by ngraham into branch 'cherry-pick-16ae8b9e'.

appmenu: Use existing menu in compact represenation

There's no need to reconstruct the entire menu, when it exists already.
Also shows correct behavior on Wayland because the imported menues have
correct parents compared to the new  one.


(cherry picked from commit 16ae8b9e69955dadab22b381963c69e2c55a9b3d)

M  +3    -7    applets/appmenu/lib/appmenuapplet.cpp
M  +10   -2    applets/appmenu/plugin/appmenumodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/e86c687d69b5058ce9f8f53ec904451df85e77d6
Comment 5 Nate Graham 2022-04-05 14:57:15 UTC
Git commit f77565c9eebd538fdb6dbb262e53f5d9668fdd14 by Nate Graham, on behalf of David Redondo.
Committed on 05/04/2022 at 14:57.
Pushed by ngraham into branch 'Plasma/5.24'.

appmenu: Use existing menu in compact represenation

There's no need to reconstruct the entire menu, when it exists already.
Also shows correct behavior on Wayland because the imported menues have
correct parents compared to the new  one.


(cherry picked from commit 16ae8b9e69955dadab22b381963c69e2c55a9b3d)

M  +3    -7    applets/appmenu/lib/appmenuapplet.cpp
M  +10   -2    applets/appmenu/plugin/appmenumodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/f77565c9eebd538fdb6dbb262e53f5d9668fdd14