-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix Sidebar Menu Focus #7829
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
base: master
Are you sure you want to change the base?
Fix Sidebar Menu Focus #7829
Conversation
Wait, Do not merge this yet! I just realized that my strategy of disabling focus for buttons in order to prevent the spacebar from triggering them could be a bad idea if we ever want to implement better keyboard accessibility support in the future. Setting Of course, we don't really have good keyboard support anyways.... but still, I kind of want to be on the road to adding more accessibility features to lmms in the future. |
Agreed, however if you search the source code, we use this trick quite liberally.
I can't reproduce this issue on macOS although I did take a minute to try to write a patch, I just have no easy way of testing this. Furthemore, even with your patch, if a plugin is clicked in the plugin listing, the spacebar stops working again. |
For me, it only occurs when you first press the small button to close the tab; normally closing/opening the tabs via the icons doesn't cause the issue.
Wow, that actually sounds like a great idea, making a dedicated class with the event filter would definitely save a lot of redundant code!
I will have to test this. |
Ok, thanks. I can reproduce this, but the PR says the following:
The only thing I can reproduce locally is by clicking the "X" to close the sidebar and the moving my mouse away, I can then hit Space to close it. Enter does nothing and I can't find a way to "... open the sidebar menus..." (In this case, when you say "menu", do you mean the sidebar itself or something else?) |
sidebar.mov |
That is odd, on my device running Arch Linux + GNOME after pressing the X button, I can keep pressing the space bar to open/close the sidebar. Edit: Wait, somehow it's only happening for the isntrument tab for me? I only just realized this when recording the video... that is even more odd. 2025-04-10.16-22-39.mp4
WHOOPS you're totally right, I just assume that enter and space did the same thing, when it appears that only space bar triggers it. |
I'm wondering whether I should just apply the |
That's fine with me -- since we've done this in the past -- as long as we remain open to reverting it all in the future in favor of a proper solution. |
This PR may have to be rethought, since it appears there is more than just the close button which is getting focus. If I have an item selected in one of the file browsers, the issue occurs. Or, if we want to convert this PR/make a new one to implement your patch to replace all the places where |
I would like to mention that I have a plan for keyboard navigation that is in the scope of #7734 |
This PR makes it so that the spacebar will not keep triggering open/closing the sidebar menus (like the instruments tab, and the file browser tabs).
All that was required was to set the focus policy of the close button to
Qt::NoFocus
which prevents the spacebar from triggering it after you click on it.