diff --git a/src/pointer/PointerManager.cpp b/src/pointer/PointerManager.cpp index 9bdb662f1..ced8d90fa 100644 --- a/src/pointer/PointerManager.cpp +++ b/src/pointer/PointerManager.cpp @@ -571,10 +571,9 @@ SP CPointerManager::renderHWCursorBuffer(SPmonitor->m_transform; // we need to scale the cursor to the right size, because it might not be (esp with XCursor) - const auto SCALEDCURSORSIZE = m_currentCursorImage.size / m_currentCursorImage.scale * state->monitor->m_scale; - const auto SCALE = texture->m_size / SCALEDCURSORSIZE; + const auto SCALE = texture->m_size / (m_currentCursorImage.size / m_currentCursorImage.scale * state->monitor->m_scale); const auto SX = SCALE.x, SY = SCALE.y; - const auto CW = SCALEDCURSORSIZE.x, CH = SCALEDCURSORSIZE.y; + const auto BW = sc(DMABUF.size.x), BH = sc(DMABUF.size.y); // Cairo pattern matrix maps destination coords to source coords (inverse of visual transform). // x_src = xx * x_dst + xy * y_dst + x0 @@ -583,13 +582,13 @@ SP CPointerManager::renderHWCursorBuffer(SPm_cursorSwapchain) return {}; // doesn't matter, we have no hw cursor, and this is only for hw cursors - const auto SCALEDCURSORSIZE = m_currentCursorImage.size / m_currentCursorImage.scale * pMonitor->m_scale; - - // A hotspot identifies a pixel, not a zero-sized point. Transforming a - // zero-sized box produces a one-past-the-edge coordinate for rotations. - return CBox{m_currentCursorImage.hotspot * pMonitor->m_scale, {1, 1}} - .transform(Math::wlTransformToHyprutils(Math::invertTransform(pMonitor->m_transform)), SCALEDCURSORSIZE.x, SCALEDCURSORSIZE.y) + return CBox{m_currentCursorImage.hotspot * pMonitor->m_scale, {0, 0}} + .transform(Math::wlTransformToHyprutils(Math::invertTransform(pMonitor->m_transform)), pMonitor->m_cursorSwapchain->currentOptions().size.x, + pMonitor->m_cursorSwapchain->currentOptions().size.y) .pos(); }