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
master
David Edmundson 7 years ago
parent 6a676d6fab
commit 4238218b76

@ -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());
}
}

@ -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());
}

Loading…
Cancel
Save