Bug 439997

Summary: Hamburger menu should not be added to context menu if user uses a global menu applet
Product: [Applications] dolphin Reporter: Kishore Gopalakrishnan <kishore96>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: felixernst, kfm-devel, nate
Priority: NOR    
Version: 21.07.80   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In: 5.86
Sentry Crash Report:

Description Kishore Gopalakrishnan 2021-07-18 10:19:19 UTC
SUMMARY
If the user uses a global menu applet and hides Dolphin's toolbar, Dolphin shows a hamburger-like menu as the first entry in the context menu. There seems to be no option to disable this in 'Settings > context menu'

STEPS TO REPRODUCE
1. Add a global menu applet to a Plasma panel
2. In Dolphin, uncheck 'Settings > Show toolbar'
3. Relaunch Dolphin
4. Right-click in the folder-view area of Dolphin.

OBSERVED RESULT
The context menu has 'menu' as the first entry. This has the same entries as the hamburger menu that appears on the toolbar.

EXPECTED RESULT
If the user is using a global menu, this entry shouldn't be added to the context menu. Dolphin already detects the presence of a global menu applet and hides in in-app menubar, so this should also be checked for while adding the context menu item.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.3
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Felix Ernst 2021-07-18 19:52:24 UTC
I originally had it like requested here. More specifically it was implemented so that if the user has *any* menu bar (either the normal one, a global one, or other alternatives) then the hamburger menu in the toolbar and the right-click context menu action would both be invisible.

This was then changed by another developer because some of the menu bar alternatives are somewhat invisible to the user. The argument was: "You can't assume what the menu [bar] will be or where it will be shown,
it might be a kilometer away from the actual window, making it useful
to have a hamburger menu in the application anyway, and won't clutter
the UI any more since there is no menu bar." see https://invent.kde.org/frameworks/kconfigwidgets/-/merge_requests/46.

So this is a bit tricky because we seem to not be able to rely on the menu bar alternatives
I guess the "menu" action in the right-click context menu is in a bit of a different situation. It is only there so users have an intuitive way back to showing the menu bar or toolbar once it was hidden. Maybe we can safely assume that users are able to access the menu sooner or later even if they are using a somewhat invisible menu bar alternative and hid the toolbar by accident.
Comment 2 Bug Janitor Service 2021-08-04 17:17:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfigwidgets/-/merge_requests/68
Comment 3 Bug Janitor Service 2021-08-13 01:25:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfigwidgets/-/merge_requests/69
Comment 4 Felix Ernst 2021-08-23 13:39:27 UTC
Git commit 233f3c25dc0b124c36ac616bcab7fa3b84315ecd by Felix Ernst.
Committed on 23/08/2021 at 13:11.
Pushed by felixernst into branch 'master'.

Hide KHamburgerMenu in QMenus when a native menu bar is used

When a native menu bar is used, users normally don't need an
additional KHamburgerMenu in any QMenus.

This was already once before the behaviour in this scenario but it
was unnecessarily changed as a side-effect of
901b049ca48e35fe9df07092a8657b1578fad300.

While the m_menuAction can be used as a normal menu by users that
don't mind invoking a QMenu to access any menu actions, its primary
use really is that of a fallback.
Therefore the existence of a native menu bar (no matter what shape
or size it might have) is enough reason for us to hide m_menuAction.
FIXED-IN: 5.86

M  +16   -2    src/khamburgermenu.cpp
M  +2    -0    src/khamburgermenu.h
M  +2    -1    src/khamburgermenu_p.h

https://invent.kde.org/frameworks/kconfigwidgets/commit/233f3c25dc0b124c36ac616bcab7fa3b84315ecd