diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-04-07 20:52:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-07 20:52:11 +0200 |
| commit | 70ae99f52162a0ed2723d45c63adfb2e61f4e2f5 (patch) | |
| tree | b3f5f8d3b781c4606e4a2f6b812459fed54a71b5 /src/managers/input/InputManager.cpp | |
| parent | a8eda7f978ed367969d0de2adc836ceb268ccd54 (diff) | |
input/layers: Fix exclusive LS focus / refocus after unmap (#9984)
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 8ca8c21d..2153b916 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -306,6 +306,17 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse) { g_pLayoutManager->getCurrentLayout()->onMouseMove(getMouseCoordsInternal()); + // forced above all + if (!g_pInputManager->m_dExclusiveLSes.empty()) { + if (!foundSurface) + foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &g_pInputManager->m_dExclusiveLSes, &surfaceCoords, &pFoundLayerSurface); + + if (!foundSurface) { + foundSurface = (*g_pInputManager->m_dExclusiveLSes.begin())->surface->resource(); + surfacePos = (*g_pInputManager->m_dExclusiveLSes.begin())->realPosition->goal(); + } + } + if (!foundSurface) foundSurface = g_pCompositor->vectorToLayerPopupSurface(mouseCoords, PMONITOR, &surfaceCoords, &pFoundLayerSurface); @@ -1420,10 +1431,15 @@ void CInputManager::refocus() { mouseMoveUnified(0, true); } -void CInputManager::refocusLastWindow(PHLMONITOR pMonitor) { +bool CInputManager::refocusLastWindow(PHLMONITOR pMonitor) { + if (!m_dExclusiveLSes.empty()) { + Debug::log(LOG, "CInputManager::refocusLastWindow: ignoring, exclusive LS present."); + return false; + } + if (!pMonitor) { refocus(); - return; + return true; } Vector2D surfaceCoords; @@ -1432,10 +1448,6 @@ void CInputManager::refocusLastWindow(PHLMONITOR pMonitor) { g_pInputManager->releaseAllMouseButtons(); - // first try for an exclusive layer - if (!m_dExclusiveLSes.empty()) - foundSurface = m_dExclusiveLSes[m_dExclusiveLSes.size() - 1]->surface->resource(); - // then any surfaces above windows on the same monitor if (!foundSurface) { foundSurface = g_pCompositor->vectorToLayerSurface(g_pInputManager->getMouseCoordsInternal(), &pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], @@ -1465,6 +1477,8 @@ void CInputManager::refocusLastWindow(PHLMONITOR pMonitor) { refocus(); } + + return true; } void CInputManager::unconstrainMouse() { |
