From 4238218b762996b41480f8d1c9a1c88930e08a11 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 18 Sep 2017 16:40:21 +0100 Subject: [PATCH] Don't scale cursor hotspot differently to cursor Summary: In the DRM plugin the cursor is currently is drawn at the native size given. Therefore we don't want to scale the icon offset as that leads to it being drawn every so slightly off-sync. BUG: 384769 Fixed-in: 5.11.0 Test Plan: Kate now selects lines based on the middle of the cursor, not the top left. I'd previously gotten so used to it, I hadn't realised it was actually a bug :/ Reviewers: #plasma, graesslin Reviewed By: #plasma, graesslin Subscribers: plasma-devel, kwin, #kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D7868 --- plugins/platforms/drm/drm_backend.cpp | 3 +-- plugins/platforms/drm/drm_output.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp index 30141ab6ef..33f894d414 100644 --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -678,12 +678,11 @@ void DrmBackend::doHideCursor() void DrmBackend::moveCursor() { - const QPoint p = Cursor::pos() - softwareCursorHotspot(); if (!m_cursorEnabled || isCursorHidden()) { return; } for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) { - (*it)->moveCursor(p); + (*it)->moveCursor(Cursor::pos()); } } diff --git a/plugins/platforms/drm/drm_output.cpp b/plugins/platforms/drm/drm_output.cpp index e32c0b387f..bdd4506164 100644 --- a/plugins/platforms/drm/drm_output.cpp +++ b/plugins/platforms/drm/drm_output.cpp @@ -104,7 +104,7 @@ void DrmOutput::showCursor(DrmDumbBuffer *c) void DrmOutput::moveCursor(const QPoint &globalPos) { - const QPoint p = (globalPos - m_globalPos) * m_scale; + const QPoint p = (globalPos * m_scale) - m_backend->softwareCursorHotspot(); drmModeMoveCursor(m_backend->fd(), m_crtc->id(), p.x(), p.y()); }