summaryrefslogtreecommitdiff
path: root/src/desktop/LayerSurface.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2024-07-27 15:03:52 +0200
committervaxerski <vaxry@vaxry.net>2024-07-27 15:04:03 +0200
commit963816b9a6524a99a6716fa1aa30b2c4f369d2f0 (patch)
tree84cc5b6e4a92e22070343a3d87628891dbbb3e89 /src/desktop/LayerSurface.cpp
parent534fdb5a375b65821adce3fec5d1622fc546b8b4 (diff)
layersurface: fixup focus issues in onUnmap
fixes #6929
Diffstat (limited to 'src/desktop/LayerSurface.cpp')
-rw-r--r--src/desktop/LayerSurface.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp
index 83b0992f..2252adca 100644
--- a/src/desktop/LayerSurface.cpp
+++ b/src/desktop/LayerSurface.cpp
@@ -212,8 +212,11 @@ void CLayerSurface::onUnmap() {
return;
// refocus if needed
- if (WASLASTFOCUS)
+ // vvvvvvvvvvvvv if there is a last focus and the last focus is not keyboard focusable, fallback to window
+ if (WASLASTFOCUS || (g_pCompositor->m_pLastFocus && !g_pCompositor->m_pLastFocus->hlSurface->keyboardFocusable()))
g_pInputManager->refocusLastWindow(PMONITOR);
+ else if (g_pCompositor->m_pLastFocus)
+ g_pSeatManager->setKeyboardFocus(g_pCompositor->m_pLastFocus.lock());
CBox geomFixed = {geometry.x + PMONITOR->vecPosition.x, geometry.y + PMONITOR->vecPosition.y, geometry.width, geometry.height};
g_pHyprRenderer->damageBox(&geomFixed);