Support cursor scaling in X windowed backend
ClosedPublic

Authored by davidedmundson on Jun 21 2018, 1:29 AM.

Details

Test Plan

Ran kwin_wayland --windowed --scale2

Hovered over deco. Got massive and detailed cursor
Hovered over a wayland client (Qt 5.11 not dev)
Got a massive, but slightly blocky cursor

Diff Detail

Repository
R108 KWin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 185
Build 185: arc lint + arc unit
davidedmundson created this revision.Jun 21 2018, 1:29 AM
Restricted Application added a project: KWin. · View Herald TranscriptJun 21 2018, 1:29 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Jun 21 2018, 1:29 AM
zzag added a subscriber: zzag.Jun 21 2018, 9:47 AM
zzag added inline comments.
plugins/platforms/x11/windowed/x11windowed_backend.cpp
417

How about

const qreal outputScale = screenScales().first();
const QSize targetSize = srcImage.size() * outputScale / srcImage.devicePixelRatio();
const QImage img = srcImage.scaled(targetSize, Qt::KeepAspectRatio);
424

Just a question: should hotspot.x() * outputScale be rounded?, e.g.

xcb_render_create_cursor(m_connection, cid, pic, qRound(hotspot.x() * outputScale), qRound(hotspot.y() * outputScale));

const and stuff

graesslin accepted this revision.Jun 22 2018, 4:55 PM
This revision is now accepted and ready to land.Jun 22 2018, 4:55 PM
This revision was automatically updated to reflect the committed changes.