From f04829a4b5aeb8f88aaf25ce7f9b9539b0d91f65 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:41:52 +0200 Subject: [PATCH] fix layer focus --- src/managers/InputManager.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index 4166fd229..29f64f56f 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -85,13 +85,15 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &surfaceCoords); // then windows - pFoundWindow = g_pCompositor->vectorToWindowIdeal(mouseCoords); - if (!foundSurface && pFoundWindow) { - if (!pFoundWindow->m_bIsX11) { - foundSurface = g_pCompositor->vectorWindowToSurface(mouseCoords, pFoundWindow, surfaceCoords); - } else { - foundSurface = g_pXWaylandManager->getWindowSurface(pFoundWindow); - surfacePos = pFoundWindow->m_vRealPosition.vec(); + if (!foundSurface) { + pFoundWindow = g_pCompositor->vectorToWindowIdeal(mouseCoords); + if (pFoundWindow) { + if (!pFoundWindow->m_bIsX11) { + foundSurface = g_pCompositor->vectorWindowToSurface(mouseCoords, pFoundWindow, surfaceCoords); + } else { + foundSurface = g_pXWaylandManager->getWindowSurface(pFoundWindow); + surfacePos = pFoundWindow->m_vRealPosition.vec(); + } } }