From 1ac1ff457ab8ef1ae6a8f2ab17ee7965adfa729f Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 20 Aug 2025 13:01:31 +0200 Subject: touch: detach from pointer input this detaches touch from pointer input. Touch should not affect where your cursor is, and it doesn't make much sense for it to move when we use touch --- src/managers/input/InputManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index f8d2a160..dff97166 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -164,13 +164,13 @@ void CInputManager::sendMotionEventsToFocused() { g_pSeatManager->setPointerFocus(g_pCompositor->m_lastFocus.lock(), LOCAL); } -void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse) { +void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, std::optional overridePos) { m_lastInputMouse = mouse; if (!g_pCompositor->m_readyToProcess || g_pCompositor->m_isShuttingDown || g_pCompositor->m_unsafeState) return; - Vector2D const mouseCoords = getMouseCoordsInternal(); + Vector2D const mouseCoords = overridePos.value_or(getMouseCoordsInternal()); auto const MOUSECOORDSFLOORED = mouseCoords.floor(); if (MOUSECOORDSFLOORED == m_lastCursorPosFloored && !refocus) @@ -1488,8 +1488,8 @@ bool CInputManager::shouldIgnoreVirtualKeyboard(SP pKeyboard) { return !pKeyboard || (client && !m_relay.m_inputMethod.expired() && m_relay.m_inputMethod->grabClient() == client); } -void CInputManager::refocus() { - mouseMoveUnified(0, true); +void CInputManager::refocus(std::optional overridePos) { + mouseMoveUnified(0, true, false, overridePos); } bool CInputManager::refocusLastWindow(PHLMONITOR pMonitor) { -- cgit v1.2.3