From 34bfb19ac98b3debdb9f38f4363d6ac7eb0039be Mon Sep 17 00:00:00 2001 From: Patrick Taibel Date: Fri, 24 Nov 2023 13:30:25 +0100 Subject: [PATCH] Adjust scale factor --- src/managers/input/InputManager.cpp | 2 +- src/managers/input/Tablets.cpp | 2 +- src/managers/input/Touch.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 372248cdfcd..8c297ff159e 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1259,7 +1259,7 @@ void CInputManager::constrainMouse(SMouse* pMouse, wlr_pointer_constraint_v1* co g_pXWaylandManager->xwaylandToWaylandCoords({PWINDOW->m_uSurface.xwayland->x, PWINDOW->m_uSurface.xwayland->y})) : PWINDOW->m_vRealPosition.goalv(); - PCONSTRAINT->cursorPosOnActivate = (MOUSECOORDS - RELATIVETO) * PWINDOW->m_fX11SurfaceScaledBy; + PCONSTRAINT->cursorPosOnActivate = (MOUSECOORDS - RELATIVETO) * PWINDOW->getX11ScaleFactor(); } if (constraint->current.committed & WLR_POINTER_CONSTRAINT_V1_STATE_CURSOR_HINT) { diff --git a/src/managers/input/Tablets.cpp b/src/managers/input/Tablets.cpp index e5968a5ac4d..c8667550d5c 100644 --- a/src/managers/input/Tablets.cpp +++ b/src/managers/input/Tablets.cpp @@ -256,7 +256,7 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti auto local = CURSORPOS - PWINDOW->m_vRealPosition.goalv(); if (PWINDOW->m_bIsX11) - local = local * PWINDOW->m_fX11SurfaceScaledBy; + local = local * PWINDOW->getX11ScaleFactor(); wlr_tablet_v2_tablet_tool_notify_motion(PTOOL->wlrTabletToolV2, local.x, local.y); } diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp index 965eee86337..42490b07483 100644 --- a/src/managers/input/Touch.cpp +++ b/src/managers/input/Touch.cpp @@ -34,7 +34,7 @@ void CInputManager::onTouchDown(wlr_touch_down_event* e) { if (m_sTouchData.touchFocusWindow) { if (m_sTouchData.touchFocusWindow->m_bIsX11) { - local = (g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchFocusWindow->m_vRealPosition.goalv()) * m_sTouchData.touchFocusWindow->m_fX11SurfaceScaledBy; + local = (g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchFocusWindow->m_vRealPosition.goalv()) * m_sTouchData.touchFocusWindow->getX11ScaleFactor(); m_sTouchData.touchSurfaceOrigin = m_sTouchData.touchFocusWindow->m_vRealPosition.goalv(); } else { g_pCompositor->vectorWindowToSurface(g_pInputManager->getMouseCoordsInternal(), m_sTouchData.touchFocusWindow, local); @@ -69,7 +69,7 @@ void CInputManager::onTouchMove(wlr_touch_motion_event* e) { auto local = g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchSurfaceOrigin; if (m_sTouchData.touchFocusWindow->m_bIsX11) - local = local * m_sTouchData.touchFocusWindow->m_fX11SurfaceScaledBy; + local = local * m_sTouchData.touchFocusWindow->getX11ScaleFactor(); wlr_seat_touch_notify_motion(g_pCompositor->m_sSeat.seat, e->time_msec, e->touch_id, local.x, local.y); wlr_seat_pointer_notify_motion(g_pCompositor->m_sSeat.seat, e->time_msec, local.x, local.y);