actually draw drag icons in the mouse cursor during drags
ClosedPublic

Authored by mart on Feb 5 2020, 4:43 PM.

Details

Summary

paint together the cursor image and the extra dnd image if available
on X11 with QDrag::setHotspot is possible to control their relative
position, which doesn't seem to have a wayland protocol correspondence
so their relative position are controlled just by the hotspot of the cursor itself

Test Plan

folder graphics from dolphin is painted correctly

Diff Detail

Repository
R108 KWin
Branch
phab/dragicon
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 22101
Build 22119: arc lint + arc unit
mart created this revision.Feb 5 2020, 4:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptFeb 5 2020, 4:43 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
mart requested review of this revision.Feb 5 2020, 4:43 PM
mart edited the test plan for this revision. (Show Details)Feb 5 2020, 4:46 PM

which doesn't seem to have a wayland protocol correspondence

It does.

A drag has a surface
A surface has a buffer
A buffer has an offset (or hotspot) to the surface

Qt does set this:
qwaylanddnd.cpp:70

pointer_input.cpp
1261

I don't think this is needed given we are copying (implicitly) via the painting into another surface

we can just p.drawImage(p_.data());

davidedmundson added inline comments.Feb 5 2020, 8:15 PM
pointer_input.cpp
1222

i.e the hotspot should be

daragIcon->offset();

from here.

mart updated this revision to Diff 75103.Feb 6 2020, 12:24 PM
  • properly use the hotspot
mart marked 2 inline comments as done.Feb 6 2020, 12:33 PM
davidedmundson accepted this revision.Feb 6 2020, 12:41 PM
This revision is now accepted and ready to land.Feb 6 2020, 12:41 PM
This revision was automatically updated to reflect the committed changes.