-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toggle the menubar with single Alt key press (auto hide) #11526
toggle the menubar with single Alt key press (auto hide) #11526
Conversation
c64366b
to
00d9a3d
Compare
I finally fixed all macOS ifndefs, this is ready for review. If no review was started I might still force-push for polishing the UI. |
00d9a3d
to
cbb5328
Compare
cbb5328
to
8f88365
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original review comments went to the wrong PR
#11566
The following findings are pending:
- Unnecessary popup window on targets with a global menu bar
- glitch when closing menus after opening the menu bar by a direct shortcut Alt+V
- Issue opening sub-sub menu when navigating with the right cursor key.
This is unrelated to this PR, and expected behaviour when the top item is a submenu. |
We may just not open the menu by default like in Firefox or move the menus with sub-menus down. Directly opening the menu, is IMHO even more usefull if we remember the previous menu. This will remove the need for moving to a diffent menu in most cases. |
How about adding "Show menu bar" in the view menu? |
Keypress handling depends on the window manager / desktop environment. Some pass the keypress to the app (e.g. Gnome), some don't (e.g. xfwm4, reason for #11566).
I can try to work around the glitch you noticed with an eventFilter() in WMainMenuBar. Btw #11572 broke this branch. I'll rebase onto main and fix it. |
a798907
to
f34b29a
Compare
The glitch with Alt+V and Alt is IMHO a minor issue that does not block this PR. If the showing the menu bar without menu is hard to do, can we than show the last menu instead of "File"? Did you consider to move the Viny control menu down to not open it when moving right to "Help"? |
I'm pretty sure this behaviour is system dependent, if a menu is highlighted at all, if that is even opened... thus I'm not inclined to touch it. |
This can happen in another PR. I'd prefer to merge the hide feature first. |
9e3d6b1
to
d0e0c42
Compare
Did you try to re-implement QMenuBar focus events? I just added this with the menu bar always on and it works as if the menu bar where always there:
This solution required a lot less code and be haves natural. |
This is a nice idea, but it doesn't work at all with xfce4, neither when pressing Alt only nor with Alt combos. As I said, the menu highlight/select behaviour varies across window managers, and with xfwm4 nothing happens when I press Alt. When I press Alt combos the repsective menu is active (note: not focused until the selection is moved with Up/Down keys) but the menubar is not addressed. |
OK than it looks like this is a bit hacky because of xfce4. Can you put a warning that we must only touch the code again when testing with xfce4? |
Correct me if I'm wrong, we tested only with Gnome (mutter) and xfce (xfwm4) so far (and Windows 10), but there are a few more window managers out there ;) so I guess testing with xfwm4 revealed issues that may occur anywhere else.
I think we may not apply the open window trick on Anyhow, I'll test some other distros/WMs, for example KDE Plasma, then we can decide how to proceed. |
Sounds good. At a bare minimum, we need some comments about the issues and workaround with xfce4 to protect it from removal. |
I'm interested in this feature, can I do some help with testing? |
Sure, feedback is welcome, everything should work as described in the first post. |
9a9a55b
to
de30750
Compare
de30750
to
9c08935
Compare
9c08935
to
5784307
Compare
5784307
to
2c56fe4
Compare
2c56fe4
to
6bf5006
Compare
I've been testing this for months now, no issues whatsoever (inkl. dev-mod, i.e. skin reload without --developer). Is anyone interested to get this into 2.5? |
Yes, unfortunately a conflict has developed. |
Thank you. LGTM |
Unfortunately it's not quite working anymore as designed: I'll take a look. edit: got it, wrongly resolved the conflicts after #11566 had been merged. |
preferred alternative to #11304 which was already reported to work on Windows and Ubuntu.
The menubar is hidden by default and can be toggled with a single Alt key press.
This is available only on Linux and Windows. On macOS there's a permanent global menu, also in fullscreen mode.
This works only with a single Alt press, Alt bindings in custom keyboard mappings don't toggle the menubar.
Users can opt-out via the popup or in Preferences > Interface.
setMinimumHeight()
to show,setFixedHeight(0)
to hideThe popup introduces this new feature but also allows to change the behaviour. This is supposed to be a safeguard to prevent locking out touch screen users who updated/installed Mixxx but may not have a keyboard attached when starting this new Mixxx version for the first time.
Please test!