Bug 516207 - When in button form, global menu does not any show any items/options after closing menu once, until un-focusing and re-focusing app
Summary: When in button form, global menu does not any show any items/options after cl...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Global Menu widget (other bugs)
Version First Reported In: 6.6.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: John
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-18 14:07 UTC by John
Modified: 2026-02-28 00:13 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.2
Sentry Crash Report:


Attachments
Global menu bug (1.09 MB, video/webm)
2026-02-21 12:30 UTC, John
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John 2026-02-18 14:07:55 UTC
SUMMARY
When in button form, global menu does not any show items/options

STEPS TO REPRODUCE
1. Place the global menu - in button form - on a panel
(i don't know if it is related but i also have a global menu on the window frames)
2. open a program (Kate, dolphin, etc)
3. click on the global menu button that was placed on the panel

OBSERVED RESULT
Almost always, the global menu does not show any items (it looks as it was locked on click-down)
However, sometimes it works the first time you press it (but only the first time...)

EXPECTED RESULT
It should always present the different menu options

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 43
KDE Plasma Version: 6.6.0
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.1
Kernel Version: 6.18.10-200.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2026-02-20 16:26:13 UTC
Can you attach a screen recording that shows the issue happening? Thanks a lot!
Comment 2 John 2026-02-21 12:30:21 UTC
Created attachment 189921 [details]
Global menu bug

Hi Nate!

Thank you for your replay.

Here's the video.
Comment 3 Nate Graham 2026-02-22 18:36:07 UTC
I can reproduce the issue!
Comment 4 Nate Graham 2026-02-22 18:55:02 UTC
Debugged this a bit. When it happens, we're in AppMenuApplet::createMenu(), here:

if (auto *menuAction = m_model->data(QModelIndex(), AppMenuModel::ActionRole).value<QAction *>()) {
            menu = menuAction->menu();
        }

The if statement is evaluating to false, and there's no else block to handle the result more nicely, so the whole function returns null and the menu doesn't open.

This code is fairly complex so I'm CCing the last few people who touched this widget.

It does occur to me that we should never have codepaths in functions intended to trigger UI changes that return early or return null; the result is broken UIs. At the minimum they should bubble up an error message, or ideally refactored to make failure impossible.
Comment 5 Bug Janitor Service 2026-02-23 11:38:14 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6342
Comment 6 cwo 2026-02-25 22:00:28 UTC
Git commit 2511c372d3922378d7f1ba8bf8c8fe230855e528 by Christoph Wolk.
Committed on 25/02/2026 at 20:53.
Pushed by cwo into branch 'master'.

applets/appmenu: set sourceMenu in Compact mode

Since 5f18319f3bf15c5d92321473850b3fbae6a2f5b5, the global menu does
some reshuffling of the menus to make the search function work properly,
and resets m_currentMenu to m_sourceMenu when the menu hides. The
problem is that for the compact (single-button) menu widget style, we
never set m_sourceMenu in the first place (as it's otherwise
unnecessary without the search function that's only available in the
full width version), so we set the menu to null. This means that if you
show the menu then click away, it can't open again (as the underlying
menu is gone) until the menu is regenerated (typically by focusing a
different window, then going back to the original one).

Instead, also set the sourceMenu in the compact style.

M  +1    -0    applets/appmenu/appmenuapplet.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/2511c372d3922378d7f1ba8bf8c8fe230855e528
Comment 7 cwo 2026-02-27 13:09:13 UTC
Git commit b38b8c530a37371e8f1eee5b411de52f65b88be5 by Christoph Wolk.
Committed on 27/02/2026 at 12:22.
Pushed by cwo into branch 'Plasma/6.6'.

applets/appmenu: set sourceMenu in Compact mode

Since 5f18319f3bf15c5d92321473850b3fbae6a2f5b5, the global menu does
some reshuffling of the menus to make the search function work properly,
and resets m_currentMenu to m_sourceMenu when the menu hides. The
problem is that for the compact (single-button) menu widget style, we
never set m_sourceMenu in the first place (as it's otherwise
unnecessary without the search function that's only available in the
full width version), so we set the menu to null. This means that if you
show the menu then click away, it can't open again (as the underlying
menu is gone) until the menu is regenerated (typically by focusing a
different window, then going back to the original one).

Instead, also set the sourceMenu in the compact style.


(cherry picked from commit 2511c372d3922378d7f1ba8bf8c8fe230855e528)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +1    -0    applets/appmenu/appmenuapplet.cpp

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