-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
skip keyboard focus for layer shell surfaces not... #818
Conversation
Hmm, so what is actually causing the issue here? xdg-popup grab docs say (emphasis mine):
It seems that currently, keyboard navigation does work in Waybar popup menus on niri. Though, on sway it doesn't—keyboard events keep going to the window instead. While the grab is active, niri will keep setting keyboard focus to the root layer surface, which (in fact, AFAICT, with this PR, niri will set the keyboard focus to the root layer surface in Could it be that the problem is caused by |
e7b7f00
to
8f6c912
Compare
Yeah, because the layer keyboard interactivity is set to None. Out of waybar, ironbar and lxqt-panel which I tested only lxqt-panel requested keyboard interactivity.
imo it should also exclude layer surfaces not requesting keyboard interactivity here. I updated the PR to do that, so now it behaves the same as in sway.
No, it has nothing to do with restoring the focus imo. imo it just worked by chance. But it seems the issue is worse when the popup unexpectedly receives keyboard focus then when only the layer surface receives it. (Which happened in the previous version of this PR which only ignored the keyboard grab). |
8f6c912
to
08255b2
Compare
This PR seems to fix a few issues I have, thanks! Is there anything I can do to help move it forward? Is anything missing that's preventing a merge? |
I'm currently deep in the floating branch, I'll get to this PR afterwards. I want to do some more testing and digging on my own here too. On that note, what other issues does it fix for you? This will be useful |
I was mistaken, I found no other issues related to this 👍 |
I can confirm this fixed #311 on my machine. Thanks! it was a daily pain to deal with this bug. |
Now that floating has been merged, would be nice if this could be revisited. |
Don't worry I'll get to it. After the y'know new year's eve and all |
a grab is requested for an unmapped popup, delay focusing the popup until the first keyboard interaction
...requesting keyboard interactivity
08255b2
to
71ce04c
Compare
rebased on current |
I'm investigating this a bit. So, with the current niri code, if I click on an icon to open a menu, this is sent:
The keyboard enters the pop-up menu surface. Next, when I click outside the menu, this happens:
The keyboard leaves the closed (nil) pop-up menu surface, then enters and immediately leaves the bar wl_surface with no keyboard interactivity. I suspect this is the grab "restoring" the keyboard focus. However, this sequence of events doesn't cause the bug: the menu keeps working. Now, if instead I open a menu, then click again without moving my mouse, then the menu will close, but there will be no further events. So it's just the first two This is when the bug happens; subsequent clicks on the same icon keep sending |
Well anyway, the keyboard focus code in niri probably needs some reworking, and this does seem to fix the issue, so let's merge it and maybe I'll come up with something better later on. |
Thanks! |
...requesting keyboard interactivity
I have seen clients reacting weird when receiving keyboard focus unexpectedly.
The last time it was about implicit focus for popups in firefox, which immediately dismissed the popup.
Looks like the same applies to layer surfaces not requesting keyboard interactivity.
fixes #311