From 729b47d46d0c749efbffe01ea863a124fad562b4 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sat, 27 Jul 2024 17:49:27 +0200 Subject: input: refocus last window on keyboard unfocusable surfaces fixes #4460 --- src/managers/input/InputManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index e2c62367..7d2e7a0e 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -17,6 +17,7 @@ #include "../../protocols/LayerShell.hpp" #include "../../protocols/core/Seat.hpp" #include "../../protocols/core/DataDevice.hpp" +#include "../../protocols/core/Compositor.hpp" #include "../../protocols/XDGShell.hpp" #include "../../devices/Mouse.hpp" @@ -1382,6 +1383,12 @@ void CInputManager::refocusLastWindow(CMonitor* pMonitor) { g_pCompositor->focusWindow(PLASTWINDOW); } else { // otherwise fall back to a normal refocus. + + if (foundSurface && !foundSurface->hlSurface->keyboardFocusable()) { + const auto PLASTWINDOW = g_pCompositor->m_pLastWindow.lock(); + g_pCompositor->focusWindow(PLASTWINDOW); + } + refocus(); } } -- cgit v1.2.3