-
-
Notifications
You must be signed in to change notification settings - Fork 830
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
Fix greedy mouse grab from keyboard_interactive layer #4401
Fix greedy mouse grab from keyboard_interactive layer #4401
Conversation
from a glimpse I don't think this will work well? Some cases:
|
On Wed Jan 10, 2024 at 9:11 AM EST, Vaxry wrote:
- open a launcher, hit a keybind to `movefocus,l` to a window. LS will get completely unfocused...?
Yes, until you mouse over it. This is an existing bug (though currently its only unfocused until you wiggle the mouse).
- open a launcher and click on an OSK, will the launcher still have kb focus?
Yes, launcher will have focus. Existing code ensures that a non-keyboard layer can't take keyboard focus.
|
fair enough. |
a3d3543
to
1ff9571
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.
lgtm
Edit: Ignore this comment, its wrong - see #4465 From my testing, the offending change is this: diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 8bfdb65c..ce7e2b30 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -359,7 +359,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
bool allowKeyboardRefocus = true;
- if (g_pCompositor->m_pLastFocus) {
+ if (!refocus && g_pCompositor->m_pLastFocus) {
const auto PLS = g_pCompositor->getLayerSurfaceFromSurface(g_pCompositor->m_pLastFocus);
if (PLS && PLS->layerSurface->current.keyboard_interactive == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE) |
There is a partial regression from the two commits discussed here (If I open bemenu/rofi/nwggrid while there's no window open, it won't get keyboard events from wvkbd) |
Describe your PR, what does it fix/add?
Fixes #2017
This allows you to use your mouse on other (not covered) surfaces even when you have a keyboard_interactive layer active.
The bug was that a keyboard_interactive layer would always take precedence over everything else (even without KEYBOARD_INTERACTIVITY_EXCLUSIVE). The fix makes that layer not take precedence, and instead makes
refocus
respect KEYBOARD_INTERACTIVITY_EXCLUSIVE (i.e. the correct behavior).So, you can
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
One case I found where the KEYBOARD_INTERACTIVITY_EXCLUSIVE is not respected:
this is an existing bug/feature (it may be intended behavior). Maybe it should be fixed now (so KEYBOARD_INTERACTIVITY_EXCLUSIVE layers keep the keyboard), or maybe fix it some other day?
Is it ready for merging, or does it need work?
This is ready. It fixes the unexpected and incorrect behavior that bothers me. (the existing movefocus behavior can be changed some other time, if that's what we want.)