-
Notifications
You must be signed in to change notification settings - Fork 23
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
Superkey shortcuts being hijacked/blocked. #55
Comments
If other things are hijacking it then you can change your keyboard shortcut to not use |
@ikeydoherty thanks for the quick reply. edit: i also use a bunch of other shortcuts that use the left super key that don't work. |
Gotcha. |
Is Brisk showing when you release the button or before? |
Confirmed that the hungry bastid is eating it |
Brisk shows when i release the button. |
@ikeydoherty I tested the original pull request for Super support it was working correctly and not swallowing Super for other applications. |
@vkareh Can you take a look? |
Of course! Just tested the latest from
I'll play with the key-binder code throughout the day and see what I can figure out. I'll report back as soon as I have something. |
Okay, here are some of my findings:
These two items seem related somehow - fixing the XSendEvent window seems to allow Compiz to finally allow shortcuts to happen on its windows. I don't understand enough about the interplay between MATE and Compiz/Marco to make a more educated guess than that, but they seem related to me... Thoughts, @flexiondotorg ? In fact, in testing mate-menu, which uses the exact same technique, I can get the same behavior of Compiz super-based shortcuts work well, but MATE super-based shortcuts don't... now I'm eager to test out the wm theory for both menu apps. I'll report back later today, hopefully |
More findings:
|
This fixes an issue where shortcuts that use the Super key are being swallowed by brisk-menu. This branch does not fix _all_ instances of the issue, but a large subset of them seem to be fixed by it. A workaround is to set any desired shortcuts that use the Super key directly in the Compiz configuration (assuming you use Compiz). This partially addresses the issues in solus-project#55.
okay, #59 fixes part of this issue by allowing the correct XEvent behavior during the keybinding filter. It's very much compatible with the way that the mate-settings-daemon does it (although I have issues with mate executing the bound command on KeyPress, rather than on KeyRelease, but whatever, it doesn't seem to interfere for now). I think the way brisk-menu does the initial key grabbing during the binding phase is where the issue lies... will keep experimenting with different key-grabbing techniques. mate-settings-daemon has a @ikeydoherty - After applying #59, does the issue persist in Budgie? Or is it a MATE-only thing? |
Budgie locks out the windows key from grabs at the compositor level so its impossible to test there |
Summary time. This is my experience so far:
Apart from the first item above, this is no longer a brisk-menu issue. It's a MATE issue. It seems that whatever higher entity is handling global keybindings in MATE has an issue with the I would try to change mate-settings-daemon to handle shortcuts on KeyRelease, rather than on KeyPress to see if that would solve the problem, but I have no idea how to even start compiling and testing it without messing up my computer... VM time? |
Welp, it seems I was wrong... I recompiled mate-settings-daemon without the key grabs, and the behavior persists between brisk-menu and mate-menu. Seems like any program that attempts global key grabs, if one of them is using
I still refuse to blame XLib for this, so I'm going to focus on the different permutations of modifier masks set during the grab phase. Maybe something along the lines of "if the bound key is Super_L, remove/add Mod4 masks to the XGrabKey call", who knows... I'm just hoping that I don't have to go the route of coding "if any other program has a bound Super_L, and this one is Mod4, then change this and that when calling XGrabKey". Not sure if I'm explaining this right, I'm running out of ideas. Research and tinkering continues... |
w00t! That was some seriously painful spelunking, but I submitted a pull request to the mate-settings-daemon project that fixes this issue for brisk menu. From what I can see, any program that expects to register global keybindings that may have similar issues (mainly using the |
hmmm - it's probably not necessary for brisk-menu to implement this, as it seems low probability that someone has brisk menu running, mapped to a I'm saying this in part because this change would mean that brisk-menu needs to request event reports from the window hierarchy of every screen, which seems both unnecessary and very likely a bad idea. The MATE settings daemon, on the other hand, is already aware of all the windows by definition, so it's relatively benign to expect it to be aware of keybindings sent to application windows. I think mate-desktop/mate-settings-daemon#179 should take care of this issue at a general level, and any other menu/launcher that feels this is necessary can make that call independently. |
OK so - does this fix the original issue with Albert? |
@ikeydoherty - it does not, as far as I know. I think Albert needs to implement the fix for it to work. I'm curious as to why it used to work and now it doesn't. Maybe it has to do with Brisk checking for KeyRelease rather than KeyPress, but I haven't been able to get Brisk to work consistently with just the KeyPress event... |
Yeah I ran into the same issues and then the Async KeyPress buggered up KeyRelease.. |
I can keep trying - since Brisk moved to Async key grabs, a lot has changed in terms of interoperability between X keybindings and Brisk. I will give it another shot and see where it leads. |
yeah, it doesn't work... all I can manage is to get brisk to show up once, after that the menu entry gets highlighted in the panel, but the menu itself doesn't open (if I squint the right way, it seems like it opens and closes in quick succession). I'm really out of ideas now - I've been trying to get this thing to work with just KeyPress for a few days now thinking it might help, but nothing... Sorry, @the-mentor 😢 |
We could maybe hack it. Make Brisk add an idle/timeout callback to then toggle the menu and cancel rapid successions ? |
@vkareh don't be sorry i know you've spent a bunch of time on it and i really appreciate it! Edit: I guess i really love my launcher and the Super_L + Spacebar key combo :D |
@ikeydoherty that seems like a good idea - a debounce is far from a hack, even though Xlib would probably disagree. @the-mentor, thanks for your patience and understanding. The only other menu in MATE that is by default bound to the Super key is the Advanced MATE Menu, and it has the exact same issue as Brisk. To change the hotkey, open |
@ikeydoherty - just realized that part of the reason that it's necessary to check for both In playing with this some more, if we do only KeyPress or only KeyRelease, Brisk gets triggered for both To clarify with an example, say I want to open a terminal, mapped to
Unless we check for both KeyPress and KeyRelease, Brisk would open at either 1 or 5, along with the terminal at 3. So in Brisk we check that nothing else was Pressed/Release in between the Super key: https://github.com/solus-project/brisk-menu/blob/master/src/lib/key-binder.c#L185-L192 None of this would be necessary with other key combinations, but to support the Does that make sense? What this means is that we're currently stuck keeping the code as is, hope mate-settings-daemon gets their pull request in to fix swallowed keys within MATE, and let other launchers implement their own logic however they choose. Then some time in the next decade we'll finally replace X with something more modern 😝 |
Alternatively we could have MSD provide the global key handlers for all MATE apps over dbus, similar to GSD. Otherwise, yes, this is the best path right now. |
MSD taking care of this would be lovely, still, they don't support single-modifier shortcuts :-/ Another alternative could be to have the different launchers/menus (Brisk, Albert, etc) provide an executable to just open its program window, so Brisk could have a I'll take a look at gnome and see how they do it... I'm already way too deep in this rabbit hole, what's a few more! |
To recap:
|
Thank you such a detailed analysis of the issue. Sorry I've been quiet on this, real life and such. I'll take care of the PR in MATE. |
I've tested mate-desktop/mate-settings-daemon#179 and release a patched version of |
@vkareh: Please see ubuntu-mate/mate-dock-applet#91 and I'm sorting our some funding for all your hard work, it is very much appreciated. |
@vkareh @ikeydoherty I think this can be closed, right? Patches landed in |
@flexiondotorg - for MATE, this is resolved. However, the original report was for albertlauncher/albert. I submitted a fix for it a few months ago but it hasn't been merged... |
@flexiondotorg @vkareh @ikeydoherty the issues with MATE R_Super key shortcuts issues still exists in my Solus MATE install. Thank you very much for all your support !! |
@ikeydoherty @vkareh This issue has been resolved in Ubuntu MATE for many months. Any reason this issue can't be closed? The fact the Albert devs haven't merged a pull request is unfortunate but no reason to keep this issue open here. |
@flexiondotorg - Good question! I think the original issue referenced the Albert launcher. I sent a patch to the project, but it never got merged. To be honest, I don't even know if it's necessary anymore, we've pretty much addressed all the keybinding blocks in m-s-d and marco at this point. |
@flexiondotorg @vkareh @ikeydoherty i'm fine with the existing resolution. |
Dear developer,
With the recent update to brisk menu 0.4.0 the super key shortcut is being hijacked and other shortcuts that use the super key dont work anymore for example i have super+space configured for "albert" launcher and it doesn't work since the latest brisk update.
Edit: this seems to only affect the left super key the right super key works fine.
Also another issue is super key opens the brisk menu it would be nice if hitting the supper key once the menu is open would close the menu.
thank you and keep up the good work.
The text was updated successfully, but these errors were encountered: