mirror of
https://github.com/hyprwm/Hyprland
synced 2025-01-09 23:29:49 +01:00
protocols/focus_grab: fix keyboard focus staying on unlisted windows
When creating a focus grab with layershell surfaces, the last active toplevel kept keyboard focus.
This commit is contained in:
parent
a2905b9e16
commit
eb1f29cfab
1 changed files with 6 additions and 0 deletions
|
@ -183,6 +183,12 @@ void CFocusGrab::start() {
|
|||
|
||||
hyprListener_touchGrabStarted.initCallback(
|
||||
&g_pCompositor->m_sSeat.seat->events.touch_grab_begin, [this](void*, void*) { this->finish(true); }, this, "CFocusGrab");
|
||||
|
||||
// If the current keyboard focus surface isn't whitelisted, kick it out.
|
||||
auto focusedSurface = g_pCompositor->m_sSeat.seat->keyboard_state.focused_surface;
|
||||
if (focusedSurface != nullptr && !isSurfaceComitted(focusedSurface)) {
|
||||
wlr_seat_keyboard_clear_focus(g_pCompositor->m_sSeat.seat);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure new surfaces are focused if under the mouse when comitted.
|
||||
|
|
Loading…
Reference in a new issue