Bug 494635 - Cannot switch menu item when opened a menu item in global menu widget.
Summary: Cannot switch menu item when opened a menu item in global menu widget.
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Global Menu widget (other bugs)
Version First Reported In: 6.2.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 494750 498034 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-10-13 06:50 UTC by sekatol
Modified: 2024-12-29 19:22 UTC (History)
10 users (show)

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


Attachments
Shows the bug. (1.79 MB, video/mp4)
2024-10-13 06:50 UTC, sekatol
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sekatol 2024-10-13 06:50:38 UTC
Created attachment 174759 [details]
Shows the bug.

SUMMARY
In global menu widget, user cannot switch menu item when opened a menu item.

STEPS TO REPRODUCE
1. Create a panel and add global menu to it.
2. Open dolphin for example. Click the "File" button on globalmenu.
3. Either move the cursor to the right "Edit" button or press the RIGHT key on the keyboard.
4. The Edit menu cannot be opened.

OBSERVED RESULT
The menu doesn't switch. Both are closed.

EXPECTED RESULT
It should switch to "Edit".

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 6.11.3-arch1-1
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3
Wayland session

ADDITIONAL INFORMATION
All programs supporting global menu have this problem.
Comment 1 Antonio Rojas 2024-10-14 16:51:45 UTC
*** Bug 494750 has been marked as a duplicate of this bug. ***
Comment 2 Lars 2024-10-14 17:56:34 UTC
I have the same issue on my system but I wanted to add to the original report and make it explicit that it *only* happens with the global menu. When I turn the global menu off, the menu in the application windows behave as expected: when I click, e.g., the "File" menu, it opens, then when I move the cursor to the right, to the "Edit" menu, and hover over it, the "File" menu closes and the "Edit" one opens.

Operating System: Fedora Linux 40
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.10.12-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 4 Nate Graham 2024-11-25 21:11:13 UTC
Can confirm.
Comment 5 Bug Janitor Service 2024-11-26 11:58:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4943
Comment 6 Vlad Zahorodnii 2024-11-28 11:44:42 UTC
Git commit b9161eeb246f2e30197af1ded659cda31cbc2172 by Vlad Zahorodnii.
Committed on 28/11/2024 at 11:26.
Pushed by vladz into branch 'master'.

applets/appmenu: Workaround global menu getting dismissed unexpectedly

Qt has a fallback code path to dismiss all popups when the application
loses keyboard focus. The issue is that QGuiApplication::focusWindow()
not always has reasonable values.

For example, after calling widget->hide(), the QGuiApplication will think
that the widget's window still has focus for a while. This can result in
popups getting unexpectedly dismissed:

- hover the File entry
- the corresponding File popup will be shown
- hover the Edit entry
- the File popup will be hidden
- the Edit popup will be shown
- at this point, QGuiApplication::focusWindow() still reports that the
  File popup window has the keyboard focus
- some time later, qtwayland will report a new focused window. It is
  racy, Qt can report either null or the Edit popup window.
- if it's null, the Edit popup will be hidden

M  +9    -0    applets/appmenu/lib/appmenuapplet.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/b9161eeb246f2e30197af1ded659cda31cbc2172
Comment 7 Vlad Zahorodnii 2024-11-28 13:33:39 UTC
Git commit d5a123f997a06bacafcc2e0b68c43c75ef90f9a0 by Vlad Zahorodnii.
Committed on 28/11/2024 at 11:58.
Pushed by vladz into branch 'Plasma/6.2'.

applets/appmenu: Workaround global menu getting dismissed unexpectedly

Qt has a fallback code path to dismiss all popups when the application
loses keyboard focus. The issue is that QGuiApplication::focusWindow()
not always has reasonable values.

For example, after calling widget->hide(), the QGuiApplication will think
that the widget's window still has focus for a while. This can result in
popups getting unexpectedly dismissed:

- hover the File entry
- the corresponding File popup will be shown
- hover the Edit entry
- the File popup will be hidden
- the Edit popup will be shown
- at this point, QGuiApplication::focusWindow() still reports that the
  File popup window has the keyboard focus
- some time later, qtwayland will report a new focused window. It is
  racy, Qt can report either null or the Edit popup window.
- if it's null, the Edit popup will be hidden


(cherry picked from commit b9161eeb246f2e30197af1ded659cda31cbc2172)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +9    -0    applets/appmenu/lib/appmenuapplet.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/d5a123f997a06bacafcc2e0b68c43c75ef90f9a0
Comment 8 Damian Wieczorek 2024-12-29 19:22:46 UTC
*** Bug 498034 has been marked as a duplicate of this bug. ***