Bug 427528

Summary: Cursor gets stuck as a grabbing hand after grabbing something in Firefox
Product: [Plasma] kwin Reporter: Nate Graham <nate>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: VERIFIED FIXED    
Severity: normal CC: bugseforuns, katyaberezyaka, kde, perso, robert.mader, shashwatkhanna312, yonatan3058
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=400014
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Trying to drag a firefox tab (kwin)
Trying to drag a firefox tab (weston)
Trying to drag a firefox tab (kwin w/o plasmashell)

Description Nate Graham 2020-10-11 03:15:15 UTC
Plasma Wayland session with git master everything.

STEPS TO REPRODUCE
1. Open Firefox
2. Click and drag a link on a page (any link, any page)
3. Drop it a few mm away anywhere

OBSERVED RESULT
The cursor gets stuck as a grabbing hand while it's within the Firefox window
Comment 1 Patrick Silva 2020-10-12 01:10:14 UTC
I can reproduce on Plasma 5.20 beta with Firefox running natively on Wayland.
bug 400014 is a similar issue.
Comment 2 Vlad Zahorodnii 2020-10-12 07:42:04 UTC
> while it's within the Firefox window
This sounds like a ff bug. Can you reproduce this bug with other wayland compositors?
Comment 3 Nate Graham 2020-10-12 17:13:46 UTC
No, I cannot reproduce the issue with Weston. In fact, dragging a link in Firefox under Weston shows no grabby hand at all.
Comment 4 Patrick Silva 2020-10-12 17:59:52 UTC
and I can't reproduce on Wayland session of Gnome 3.38.1.
Comment 5 Vlad Zahorodnii 2020-10-15 18:56:03 UTC
Yep, can confirm.
Comment 6 Vlad Zahorodnii 2020-10-15 19:08:32 UTC
Created attachment 132394 [details]
Trying to drag a firefox tab (kwin)
Comment 7 Vlad Zahorodnii 2020-10-15 19:08:50 UTC
Created attachment 132395 [details]
Trying to drag a firefox tab (weston)
Comment 8 Vlad Zahorodnii 2020-10-15 19:14:14 UTC
Created attachment 132396 [details]
Trying to drag a firefox tab (kwin w/o plasmashell)
Comment 9 Vlad Zahorodnii 2020-10-28 17:42:54 UTC
Git commit aa42b54004d07f58253f7bd4f0e5d69b2466cd33 by Vlad Zahorodnii.
Committed on 28/10/2020 at 17:42.
Pushed by vladz into branch 'master'.

Send a cancelled() event if the dnd data source is not accepted

Currently, Firefox will stuck in "dnd" mode if you try to drag any of
its tabs. The main reason for that is that kwin doesn't send the
wl_data_source.cancelled event if the pointer button has been released
and there is no target surface or if the data source hasn't been
accepted by anyone.

M  +3    -0    src/server/datadevice_interface.cpp
M  +12   -0    src/server/datasource_interface.cpp
M  +3    -0    src/server/datasource_interface.h
M  +18   -6    src/server/seat_interface.cpp

https://invent.kde.org/plasma/kwayland-server/commit/aa42b54004d07f58253f7bd4f0e5d69b2466cd33
Comment 10 Vlad Zahorodnii 2020-10-28 18:29:13 UTC
So, the problem was that kwin didn't send an event to indicate that a drag has been cancelled. With aa42b54004d07f58253f7bd4f0e5d69b2466cd33, the cursor should be normal after a drop.

However, I've noticed that dnd and copy pasting stop working in firefox after you use it for a while. What's more interesting is that I can reproduce the same issue with weston...
Comment 11 Vlad Zahorodnii 2020-10-29 09:31:32 UTC
For the most part, dragging-and-dropping works fine with Firefox now, so I'm closing this bug report.
Comment 12 Robert Mader 2020-10-31 10:19:41 UTC
(In reply to Vlad Zahorodnii from comment #10)
> However, I've noticed that dnd and copy pasting stop working in firefox
> after you use it for a while. What's more interesting is that I can
> reproduce the same issue with weston...

For the record: this is tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1622107 and a known issue, on all compositors.
Comment 13 Vlad Zahorodnii 2020-11-02 07:32:28 UTC
@Robert Aha, that's good to know. Thank you! :-)
Comment 14 Nate Graham 2020-11-05 21:33:12 UTC
Verified fixed, but while testing, I found a similar issue for the desktop: Bug 428747
Comment 15 Yonatan Avhar 2022-10-06 07:10:57 UTC
This is still happening for me (Arch Linux, KWin Wayland version 2.25.5, Firefox version 105.0.2, entire system up to date as of 2022-10-06).

Dragging anything on the page (link, selected text) will cause the cursor to get stuck as a grabbing hand.
Comment 16 shashwatkhanna312 2022-10-10 19:47:06 UTC
Can confirm. I assume this is a recent regression because it worked fine in the past.
Comment 17 Jeffrey Bouter 2022-10-28 07:53:09 UTC
I am affected by the issue too. I can temporarily resolve the issue by dragging a tab outside of Firefox (creating a new window)
Comment 18 Patrick Silva 2022-10-28 16:22:30 UTC
Possibly fixed by this patch merged recently

https://invent.kde.org/plasma/kwin/-/merge_requests/3110
Comment 19 shashwatkhanna312 2022-11-10 17:05:45 UTC
> (In reply to Patrick Silva from comment #18)
> Possibly fixed by this patch merged recently
> 
> https://invent.kde.org/plasma/kwin/-/merge_requests/3110

Yup, can't reproduce it on Plasma 5.26.3. Thanks!