diff options
| author | Dregu <ville.nousiainen@gmail.com> | 2026-03-19 21:18:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-19 19:18:29 +0000 |
| commit | 3b902a47fe0126c9e0fb7fbe2e47b7c1db6b39cf (patch) | |
| tree | d7a67cea5ddf148cd958b65e1908e59d0c051b4e /src/managers/input/InputManager.cpp | |
| parent | ad46ff635bcf7b4877b03e97d8e85468f025f4a1 (diff) | |
input: fix touch screen focus on multi monitor (#13764)
* input: fix touch screen focus on multi monitor
* skip some more strictly pointer related things for touch
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index d88b29cd..109bce68 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -241,7 +241,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st m_lastCursorPosFloored = MOUSECOORDSFLOORED; - const auto PMONITOR = isLocked() && Desktop::focusState()->monitor() ? Desktop::focusState()->monitor() : g_pCompositor->getMonitorFromCursor(); + // use mouseCoords specifically in case touch sent overridePos, otherwise touch doesn't work on non-focused monitor + const auto PMONITOR = isLocked() && Desktop::focusState()->monitor() ? Desktop::focusState()->monitor() : g_pCompositor->getMonitorFromVector(mouseCoords); // this can happen if there are no displays hooked up to Hyprland if (PMONITOR == nullptr) @@ -256,7 +257,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st g_pCompositor->scheduleFrameForMonitor(PMONITOR, Aquamarine::IOutput::AQ_SCHEDULE_CURSOR_MOVE); // constraints - if (!g_pSeatManager->m_mouse.expired() && isConstrained()) { + if (mouse && !g_pSeatManager->m_mouse.expired() && isConstrained()) { const auto SURF = Desktop::View::CWLSurface::fromResource(Desktop::focusState()->surface()); const auto CONSTRAINT = SURF ? SURF->constraint() : nullptr; @@ -337,7 +338,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st // if we are holding a pointer button, // and we're not dnd-ing, don't refocus. Keep focus on last surface. - if (!PROTO::data->dndActive() && !m_currentlyHeldButtons.empty() && Desktop::focusState()->surface() && Desktop::focusState()->surface()->m_mapped && + if (mouse && !PROTO::data->dndActive() && !m_currentlyHeldButtons.empty() && Desktop::focusState()->surface() && Desktop::focusState()->surface()->m_mapped && g_pSeatManager->m_state.pointerFocus && !m_hardInput) { foundSurface = g_pSeatManager->m_state.pointerFocus.lock(); @@ -643,8 +644,10 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st m_lastFocusOnLS = true; } - g_pSeatManager->setPointerFocus(foundSurface, surfaceLocal); - g_pSeatManager->sendPointerMotion(time, surfaceLocal); + if (mouse) { + g_pSeatManager->setPointerFocus(foundSurface, surfaceLocal); + g_pSeatManager->sendPointerMotion(time, surfaceLocal); + } } void CInputManager::onMouseButton(IPointer::SButtonEvent e, SP<IPointer> mouse) { |
