diff options
Diffstat (limited to 'src/managers/input/Touch.cpp')
| -rw-r--r-- | src/managers/input/Touch.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp index eab01528..f8964521 100644 --- a/src/managers/input/Touch.cpp +++ b/src/managers/input/Touch.cpp @@ -27,7 +27,7 @@ void CInputManager::onTouchDown(ITouch::SDownEvent e) { PMONITOR = PMONITOR ? PMONITOR : g_pCompositor->m_lastMonitor.lock(); - g_pCompositor->warpCursorTo({PMONITOR->vecPosition.x + e.pos.x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e.pos.y * PMONITOR->vecSize.y}, true); + g_pCompositor->warpCursorTo({PMONITOR->m_position.x + e.pos.x * PMONITOR->m_size.x, PMONITOR->m_position.y + e.pos.y * PMONITOR->m_size.y}, true); refocus(); @@ -43,11 +43,11 @@ void CInputManager::onTouchDown(ITouch::SDownEvent e) { return; // TODO: Don't swipe if you touched a floating window. } else if (*PSWIPETOUCH && (m_pFoundLSToFocus.expired() || m_pFoundLSToFocus->m_layer <= 1) && !g_pSessionLockManager->isSessionLocked()) { - const auto PWORKSPACE = PMONITOR->activeWorkspace; + const auto PWORKSPACE = PMONITOR->m_activeWorkspace; const auto STYLE = PWORKSPACE->m_renderOffset->getStyle(); const bool VERTANIMS = STYLE == "slidevert" || STYLE.starts_with("slidefadevert"); - const double TARGETLEFT = ((VERTANIMS ? gapsOut.m_top : gapsOut.m_left) + *PBORDERSIZE) / (VERTANIMS ? PMONITOR->vecSize.y : PMONITOR->vecSize.x); - const double TARGETRIGHT = 1 - (((VERTANIMS ? gapsOut.m_bottom : gapsOut.m_right) + *PBORDERSIZE) / (VERTANIMS ? PMONITOR->vecSize.y : PMONITOR->vecSize.x)); + const double TARGETLEFT = ((VERTANIMS ? gapsOut.m_top : gapsOut.m_left) + *PBORDERSIZE) / (VERTANIMS ? PMONITOR->m_size.y : PMONITOR->m_size.x); + const double TARGETRIGHT = 1 - (((VERTANIMS ? gapsOut.m_bottom : gapsOut.m_right) + *PBORDERSIZE) / (VERTANIMS ? PMONITOR->m_size.y : PMONITOR->m_size.x)); const double POSITION = (VERTANIMS ? e.pos.y : e.pos.x); if (POSITION < TARGETLEFT || POSITION > TARGETRIGHT) { beginWorkspaceSwipe(); @@ -62,7 +62,7 @@ void CInputManager::onTouchDown(ITouch::SDownEvent e) { } if (g_pSessionLockManager->isSessionLocked()) { - m_sTouchData.touchFocusLockSurface = g_pSessionLockManager->getSessionLockSurfaceForMonitor(PMONITOR->ID); + m_sTouchData.touchFocusLockSurface = g_pSessionLockManager->getSessionLockSurfaceForMonitor(PMONITOR->m_id); if (!m_sTouchData.touchFocusLockSurface) Debug::log(WARN, "The session is locked but can't find a lock surface"); else @@ -77,7 +77,7 @@ void CInputManager::onTouchDown(ITouch::SDownEvent e) { Vector2D local; if (m_sTouchData.touchFocusLockSurface) { - local = g_pInputManager->getMouseCoordsInternal() - PMONITOR->vecPosition; + local = g_pInputManager->getMouseCoordsInternal() - PMONITOR->m_position; m_sTouchData.touchSurfaceOrigin = g_pInputManager->getMouseCoordsInternal() - local; } else if (!m_sTouchData.touchFocusWindow.expired()) { if (m_sTouchData.touchFocusWindow->m_isX11) { @@ -144,13 +144,13 @@ void CInputManager::onTouchMove(ITouch::SMotionEvent e) { } if (m_sTouchData.touchFocusLockSurface) { const auto PMONITOR = g_pCompositor->getMonitorFromID(m_sTouchData.touchFocusLockSurface->iMonitorID); - g_pCompositor->warpCursorTo({PMONITOR->vecPosition.x + e.pos.x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e.pos.y * PMONITOR->vecSize.y}, true); - auto local = g_pInputManager->getMouseCoordsInternal() - PMONITOR->vecPosition; + g_pCompositor->warpCursorTo({PMONITOR->m_position.x + e.pos.x * PMONITOR->m_size.x, PMONITOR->m_position.y + e.pos.y * PMONITOR->m_size.y}, true); + auto local = g_pInputManager->getMouseCoordsInternal() - PMONITOR->m_position; g_pSeatManager->sendTouchMotion(e.timeMs, e.touchID, local); } else if (validMapped(m_sTouchData.touchFocusWindow)) { const auto PMONITOR = m_sTouchData.touchFocusWindow->m_monitor.lock(); - g_pCompositor->warpCursorTo({PMONITOR->vecPosition.x + e.pos.x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e.pos.y * PMONITOR->vecSize.y}, true); + g_pCompositor->warpCursorTo({PMONITOR->m_position.x + e.pos.x * PMONITOR->m_size.x, PMONITOR->m_position.y + e.pos.y * PMONITOR->m_size.y}, true); auto local = g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchSurfaceOrigin; if (m_sTouchData.touchFocusWindow->m_isX11) @@ -160,7 +160,7 @@ void CInputManager::onTouchMove(ITouch::SMotionEvent e) { } else if (!m_sTouchData.touchFocusLS.expired()) { const auto PMONITOR = m_sTouchData.touchFocusLS->m_monitor.lock(); - g_pCompositor->warpCursorTo({PMONITOR->vecPosition.x + e.pos.x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e.pos.y * PMONITOR->vecSize.y}, true); + g_pCompositor->warpCursorTo({PMONITOR->m_position.x + e.pos.x * PMONITOR->m_size.x, PMONITOR->m_position.y + e.pos.y * PMONITOR->m_size.y}, true); const auto local = g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchSurfaceOrigin; |
