From 0e252d2c7770f712ed5395d75e31138abf0ea048 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 28 Feb 2023 23:17:04 +0000 Subject: [PATCH] Don't set surface cursors for overriden --- src/managers/input/InputManager.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index e712f4af..f20aed29 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -308,14 +308,16 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { setCursorIconOnBorder(pFoundWindow); } - // if we're on an input deco, reset cursor - if (!VECINRECT(m_vLastCursorPosFloored, pFoundWindow->m_vRealPosition.vec().x, pFoundWindow->m_vRealPosition.vec().y, - pFoundWindow->m_vRealPosition.vec().x + pFoundWindow->m_vRealSize.vec().x, pFoundWindow->m_vRealPosition.vec().y + pFoundWindow->m_vRealSize.vec().y)) { - wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor); - cursorSurfaceInfo.bUsed = false; - } else if (!cursorSurfaceInfo.bUsed) { - cursorSurfaceInfo.bUsed = true; - wlr_cursor_set_surface(g_pCompositor->m_sWLRCursor, cursorSurfaceInfo.pSurface, cursorSurfaceInfo.vHotspot.x, cursorSurfaceInfo.vHotspot.y); + // if we're on an input deco, reset cursor. Don't on overriden + if (!m_bCursorImageOverriden) { + if (!VECINRECT(m_vLastCursorPosFloored, pFoundWindow->m_vRealPosition.vec().x, pFoundWindow->m_vRealPosition.vec().y, + pFoundWindow->m_vRealPosition.vec().x + pFoundWindow->m_vRealSize.vec().x, pFoundWindow->m_vRealPosition.vec().y + pFoundWindow->m_vRealSize.vec().y)) { + wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor); + cursorSurfaceInfo.bUsed = false; + } else if (!cursorSurfaceInfo.bUsed) { + cursorSurfaceInfo.bUsed = true; + wlr_cursor_set_surface(g_pCompositor->m_sWLRCursor, cursorSurfaceInfo.pSurface, cursorSurfaceInfo.vHotspot.x, cursorSurfaceInfo.vHotspot.y); + } } if (*PFOLLOWMOUSE != 1 && !refocus) {