actually draw drag icons in the mouse cursor during drags
ClosedPublic

Authored by mart on Wed, Feb 5, 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Wed, Feb 5, 4:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptWed, Feb 5, 4:43 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
mart requested review of this revision.Wed, Feb 5, 4:43 PM
mart edited the test plan for this revision. (Show Details)Wed, Feb 5, 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
1262

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.Wed, Feb 5, 8:15 PM
pointer_input.cpp
1222

i.e the hotspot should be

daragIcon->offset();

from here.

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