Bug 450460 - Cannot drag and drop file into opened VLC window (XWayland) but rather onto VLC's taskmanager icon, which creates a new VLC instance
Summary: Cannot drag and drop file into opened VLC window (XWayland) but rather onto V...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.24.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland
: 452266 458611 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-17 14:11 UTC by postix
Modified: 2022-09-02 18:55 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2022-02-17 14:11:02 UTC
STEPS TO REPRODUCE
1. Open Dolphin, have some audio / video file, e.g. "example.mp3"
2. Open VLC 3.0.16
3. Drag and drop "example.mp3" into the VLC window

OBSERVED RESULT
The drag cursor with the icon of "example.mp3" just stays there and first vanishes when you click somewhere else, but besides that, nothing is dropped.

STEPS TO REPRODUCE
4. Instead of 3., drag and drop "example.mp3" on the icon only taskmanager entry of the running VLC instance.

OBSERVED RESULT
When hovering the mouse over the icon, the already running VLC window raises.
Dropping it on the icon however, opens a new instance of the VLC, where "example.mp3" is played back.


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220214
KDE Plasma Version: 5.24.0
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.8-1-default (64-bit)
Graphics Platform: Wayland
Comment 1 postix 2022-02-17 14:31:26 UTC
I tested it also with IntelliJ PyCharm, which runs under XWayland, here DND does not work too, but dropping a file onto the taskmanager icon also does not create a new instance.
Comment 2 Nate Graham 2022-02-17 23:21:25 UTC
For me, no new instance is created when I drag the file on the Task Manager icon. That works as expected, appending the dropped file onto the existing playlist (if any). and playing it

I can reproduce nothing happening when a file is dropped on the main window though.
Comment 3 Nate Graham 2022-04-04 20:36:47 UTC
*** Bug 452266 has been marked as a duplicate of this bug. ***
Comment 4 Marco Martin 2022-04-19 14:33:19 UTC
can reproduce, needs investigation
Comment 5 David Redondo 2022-05-13 13:40:29 UTC
When the drag is dropped SeatInterface emits dragEnded(), at this point the data source is reset and the drag object deleted:
https://invent.kde.org/plasma/kwin/-/blob/master/src/xwayland/dnd.cpp#L165

VLC will only ask for data after the drop has happened but at that point since wlsource is null we just ignore it:
https://invent.kde.org/plasma/kwin/-/blob/master/src/xwayland/selection.cpp#L238
Comment 6 David Edmundson 2022-05-19 06:57:22 UTC
Git commit 20a94d71577d39d92d72cb2d74f49414cd1f72d6 by David Edmundson, on behalf of David Redondo.
Committed on 19/05/2022 at 06:45.
Pushed by davidre into branch 'master'.

xwayland: Keep source/Xvisit  alive for longer

SeatInterface emits dragEnded when the drag is dropped. The target may want
to interact with the data source after the drop happened, for example only
fetching data after the drop and not during the drag.
(Note that the Wayland protocol has the same
Xvisits are now not deleted prematurely but only when they are really finished.
(Note that the Wayland protocol has the same distinction between dropped and
finished so it maps nicely).
For storing  previous visits the same code pattern as in the rest of the XWayland
DND code is used.
The SelectionSource is reset when the next Drag/Drop operation involving a X window
is started (see startDrag and doHandleXfixesNotify) or when the Wayland source is
about to be deleted.
FIXED-in:5.25.0

M  +8    -7    src/xwayland/dnd.cpp
M  +15   -1    src/xwayland/xwldrophandler.cpp
M  +1    -0    src/xwayland/xwldrophandler.h

https://invent.kde.org/plasma/kwin/commit/20a94d71577d39d92d72cb2d74f49414cd1f72d6
Comment 7 Nate Graham 2022-09-02 18:55:54 UTC
*** Bug 458611 has been marked as a duplicate of this bug. ***