Bug 465444 - xwayland firefox tab doesnt appear unless mouse over
Summary: xwayland firefox tab doesnt appear unless mouse over
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-07 20:10 UTC by Tom Englund
Modified: 2023-04-08 13:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Englund 2023-02-07 20:10:43 UTC
dragging a tab from the "tab bar" in firefox and dropping it on the desktop when firefox runs in xwayland shows an "small preview window" that gets stuck on the desktop and unless you mouse over the preview it doesnt finish and if you are doing it to slow it seems to cancel the drag and drop.

screenshot of the "preview window"
https://i.imgur.com/YVNcITM.png

STEPS TO REPRODUCE
1. run firefox in xwayland
2. drag a tab and drop it on the desktop.
3. "ghost window" gets stuck, mouse over it fast enough and the new window gets created.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 6.1.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 30,7 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Acer
Product Name: Nitro AN515-45
Comment 1 Nate Graham 2023-02-08 18:57:30 UTC
Works for me when Firefox is in native Wayland mode. Does it also work for you?
Comment 2 Tom Englund 2023-02-08 19:07:16 UTC
(In reply to Nate Graham from comment #1)
> Works for me when Firefox is in native Wayland mode. Does it also work for
> you?

yeah it does, only xwayland mode it does this behaviour. however having some weird issues with running it wayland mode because of nvidia and dgpu. so thought id report it atleast, doesnt seem like it should behave like this :p , or is it perhaps some flaw of firefox itself?
Comment 3 Tom Englund 2023-02-08 19:10:05 UTC
i guess its worth mentioning nvidia is a bit flawed regarding xwayland too, https://gitlab.freedesktop.org/xorg/xserver/-/issues/1317 but that should only make it misrender i guess? and not, not finish the drag and drop.
Comment 4 Tom Englund 2023-02-08 19:19:48 UTC
yeah tested on amdgpu laptop, same deal there.
Comment 5 Vlad Zahorodnii 2023-02-10 08:50:34 UTC
sounds like an xwayland dnd issue
Comment 6 David Edmundson 2023-02-13 10:51:36 UTC
I can reproduce. 

It's about xwayland getting mouse events.

 - drag from firefox to the desktop
 - reproduce the "glitch"
 - move the mouse over xterm
 - firefox springs back to life

It's still not fully clear where the bug lies between kwin, xwayland, gtk or firefox.
Comment 7 Bug Janitor Service 2023-02-13 15:47:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3592
Comment 8 David Edmundson 2023-04-07 22:14:41 UTC
Git commit 023fc220a1267876ebb210619672271f8c2130d7 by David Edmundson.
Committed on 07/04/2023 at 22:14.
Pushed by davidedmundson into branch 'master'.

wayland: Update pointer state before ending the drag

ending a drag will update focus. Kwin explicitly resets it to whatever
is now under the mouse now that the implicit grab has ended.

This means no-one sends a pointer up.

Clients (xwayland) don't automatically make leave events count as a
mouse up, because typically you don't get a leave event whilst we have a
grab.

Xwayland also can't track the status of the wl_datasource as it didn't
use it.

This patch shouldn't affect any wayland clients as we don't send a frame event
until the focus changes which is after the dnd_finished events.

Testing done:
 - dragged firefox under xwayland tabs out from firefox to the desktop
 - confirmed a new window appeared

M  +4    -2    src/wayland/autotests/client/test_drag_drop.cpp
M  +1    -0    src/wayland/seat_interface.cpp

https://invent.kde.org/plasma/kwin/commit/023fc220a1267876ebb210619672271f8c2130d7