Bug 488317

Summary: Drag and drop not possible with tablet stylus on Wayland
Product: [Plasma] kwin Reporter: Kath <krazykath>
Component: Wayland drag-and-drop for window contentAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: krazykath, nate, nicolas.fella
Priority: NOR Keywords: wayland
Version: 6.0.5   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Kath 2024-06-10 18:07:32 UTC
SUMMARY
Many normally draggable items do not respond to drags made with a tablet pen. For example:
- Dragging emails into folders in Kmail
- Dragging files in Dolphin
- Reordering icons in a task manager

Interestingly, tabs in Konsole and Kate can be dragged with a tablet pen. This is the only widget I have found so far that works.

STEPS TO REPRODUCE
1. Use a tablet pen
2. Attempt to drag an item that is normally draggable

OBSERVED RESULT
The item is not dragged, and only registers the initial click

EXPECTED RESULT
The item is dragged as when using a mouse

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.8.11-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × Intel® Core™ i9-9900K CPU @ 3.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2

ADDITIONAL INFORMATION
Tablet: Wacom Intuos Draw Small -  CTH-490

Enabling touch mode on my tablet, so it functions as a touchpad, and then using my hand does work correctly. This issue seems specific to using the tablet pen.
Comment 1 Nate Graham 2024-06-10 20:48:07 UTC
I'm afraid each case where you see this needs its own bug report, as on Wayland the implementation of stylus handling is per-app, not universal. So please feel free to open individual bug reports, one per issue.
Comment 2 Kath 2024-06-10 20:51:31 UTC
Thanks for letting me know, I'll get to work on individual bug reports
Comment 3 Nicolas Fella 2024-06-12 14:28:05 UTC
This is half a Qt problem and half a KWin problem.

The Qt part is fixed with https://codereview.qt-project.org/c/qt/qtwayland/+/568059 and https://codereview.qt-project.org/c/qt/qtwayland/+/568058

The KWin problem is that the dragging code only considers pointer and touch input, but not tablet input. See e.g. https://invent.kde.org/plasma/kwin/-/blob/master/src/wayland/datadevice.cpp#L98

So ultimately all those cases have a common root cause. Sorry for making you file these separate reports
Comment 4 Nicolas Fella 2024-06-12 14:28:57 UTC
*** Bug 488329 has been marked as a duplicate of this bug. ***
Comment 5 Nicolas Fella 2024-06-12 14:29:18 UTC
*** Bug 488333 has been marked as a duplicate of this bug. ***
Comment 6 Nicolas Fella 2024-06-12 14:30:24 UTC
*** Bug 488331 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2024-06-12 17:19:55 UTC
Ohh, TIL. Sorry from me too!