Bug 476566

Summary: Wine drag & drop coordinates off with Wayland fractional scaling
Product: [Plasma] kwin Reporter: David Warner <david.p.warner>
Component: Wayland drag-and-dropAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: akselmo, kde, nate, xaver.hugl
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.27.9   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.1
Sentry Crash Report:
Attachments: foobar2000 screenshot

Description David Warner 2023-11-05 02:31:25 UTC
Created attachment 162872 [details]
foobar2000 screenshot

SUMMARY
Drag & drop coordinates in Wine apps are wrong when Wayland fractional scaling is enabled.

STEPS TO REPRODUCE
1. Set monitor to 150% scaling (Wayland session).
2. Install foobar2000, select Album List + Properties layout.
3. Drag file(s) from Dolphin to foobar2000 playlist area.

OBSERVED RESULT
The drop target area is off by a factor of 1.5. For example, if the playlist area top left corner is positioned at (640,360), the mouse needs to be moved to (960,540) for the drop reticle to appear.

EXPECTED RESULT
The mouse coordinates should match the drop target coordinates.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
Wine DPI scaling doesn't make seem to make a difference (configured via winecfg).
Comment 1 Akseli Lahtinen 2023-11-07 12:36:08 UTC
Can confirm this issue, the coordinates are offset. It also seems that the Wine application is not scaled at all, text wise.
Comment 2 David Warner 2023-11-07 12:50:49 UTC
(In reply to Akseli Lahtinen from comment #1)
> Can confirm this issue, the coordinates are offset. It also seems that the
> Wine application is not scaled at all, text wise.

Thanks for confirming.

Wine has its own DPI settings (winecfg -> Graphics -> Screen resolution > 144 dpi (for 150%)), which scales text and other elements, at least on my machine. This setting doesn't seem to change the drag & drop behaviour, however.
Comment 3 David Edmundson 2024-05-28 08:05:45 UTC
Fixed with 447994581b80e37394aa721d63d05f65a5fb538b
Comment 4 David Warner 2024-06-20 10:06:25 UTC
Confirmed fixed in Plasma 6.1 - thank you!