Bug 496243 - Wrong mouse cursor is used for some Java Swing Drag-and-Drop operations
Summary: Wrong mouse cursor is used for some Java Swing Drag-and-Drop operations
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.2.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-14 00:07 UTC by Pavel Braginskiy
Modified: 2024-12-07 10:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of the bug (27.32 KB, image/png)
2024-11-14 00:07 UTC, Pavel Braginskiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Braginskiy 2024-11-14 00:07:33 UTC
Created attachment 175797 [details]
Screenshot of the bug

SUMMARY
When performing a drag-and-drop operation originating from a Java Swing application, the mouse cursor is constantly shown as the Not Available cursor, even if the application indicates that the drag is possible and the normal Move cursor should be used, see screenshot.

I tried switching to Gnome on Wayland and Plasma on X11 and both of these made the bug go away, the incorrect cursor displays only in Plasma on Wayland.

STEPS TO REPRODUCE
1.  Launch any Java Swing app that support drag-and-drop. The DnD demo application at https://docs.oracle.com/javase/tutorial/uiswing/dnd/basicdemo.html works for this purpose, I also tested with other apps.
2. Attempt to drag a drag-able item from the application

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 41
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0

ADDITIONAL INFORMATION
openjdk 17.0.13 2024-10-15
OpenJDK Runtime Environment (Red_Hat-17.0.13.0.11-1) (build 17.0.13+11)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.13.0.11-1) (build 17.0.13+11, mixed mode, sharing)

I'm guessing this is a bug in kwin, but I'm not completely certain. This is my first time filing a bug with KDE, I apologize if I did something wrong.
Comment 1 David Edmundson 2024-11-21 15:15:16 UTC
can you run

WAYLAND_DEBUG=1 yourApp |& grep wl_data

and perform the drag and attach the log.
It will show all drag and drop operations sent over the wire.

What I am 99% sure is happening is that the application is not telling the compositor that it will accept the drag & drop through the protocol. That would be an application bug even if it's an internal drag.

On kwin, kwin updates the cursor during the drag, on Gnome the app (currently) is in control of the cursor.
Comment 2 Pavel Braginskiy 2024-11-22 06:50:44 UTC
(In reply to David Edmundson from comment #1)
> can you run
> 
> WAYLAND_DEBUG=1 yourApp |& grep wl_data
> 
> and perform the drag and attach the log.
> It will show all drag and drop operations sent over the wire.

Swing doesn't have support for Wayland yet, so any Swing apps are necessarily using XWayland, so WAYLAND_DEBUG=1 doesn't produce any extra output.
Comment 3 Pavel Braginskiy 2024-11-22 06:54:19 UTC
I also tried the instructions at https://docs.fedoraproject.org/en-US/quick-docs/troubleshooting-wayland-problems/ and found that the bug wasn't present under Weston.
Comment 4 Bug Janitor Service 2024-12-07 03:46:25 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!