Bug 489372

Summary: (Wayland) VirtualBox windows are moving to the bottom when Plasma Panel changes its floating state, also breaking Peek at Desktop and Edit Mode
Product: [Plasma] kwin Reporter: Kevin Trickster <kooltechnologytricks>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: 2gd4who, crupest, leanguedes, sergio.callegari
Priority: NOR    
Version: 6.1.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: VirtualBox window "walking" when another window belonging to vbox touches and changes the state of the panel.

Description Kevin Trickster 2024-06-28 12:40:46 UTC
SUMMARY
Oracle VM VirtualBox windows are moving to the bottom of the screen when Plasma Panel changes its floating state. If panel is defloated, Peek at Desktop and Edit Mode will be immediately cancelled after activating them.

STEPS TO REPRODUCE
1. Make sure you have a floating panel and it is always visible (Right-click on the panel -> Show Panel Configuration -> Panel Settings -> Style -> Floating enabled, Visibility -> Always visible).
2. Minimize all windows to make the panel actually floating.
3. Open Oracle VM VirtualBox. Its window will move to the bottom of the screen. If not, move it higher, then reopen.
4. Open other window (e.g., Dolphin) and move it to the panel to make it defloat, then move away. VirtualBox will move to the bottom again. If VirtualBox is reached to the bottom and the panel isn't positioned at the bottom, then VirtualBox will slide to the right, until it reaches to the bottom right corner.
5. Make the panel defloat by moving window close to it or maximizing window.
6. Activate Peek at Desktop (Meta+D) or enter Edit Mode. It will immediately cancel.

OBSERVED RESULT
VirtualBox windows are moving on their own. Peek at Desktop and Edit Mode sometimes fail.

EXPECTED RESULT
VirtualBox windows shouldn't move on their own. Peek at Desktop and Edit Mode should always work whenever I use them.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
This happens only on Wayland, any GPU and drivers. This bug was discovered after upgrading to Plasma 6.1.0.

I tested this bug in VM on KDE Neon. In process, Plasma stuck in crash loop, and couldn't exit it after reboot. I don't know if it's related to this bug, or it's just buggy KDE Neon. Before I tested this many times on host machine, and Plasma never crashed.
Comment 1 crupest 2024-07-22 07:12:12 UTC
I can reproduce this on my system. The symptom is exactly like what Kevin Trickster said.

By the way, one of my wine app also breaks, which might be related this bug. When VirtualBox is running and the app is fullscreen, the screen keeps flashing white, while this problem does not occur when VirtualBox is closed.

Here are my system info:
Operating System: Arch Linux 
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.9.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 2 Nathan 2024-07-29 19:07:52 UTC
I am having the same issue. I notice its worse when Firefox is open at the same time. I have been trying to capture a video of it for a while. It very frustrating the windows moving to the bottom on their own.
Comment 3 Nathan 2024-07-29 19:09:50 UTC
(In reply to Nathan from comment #2)
> I am having the same issue. I notice its worse when Firefox is open at the
> same time. I have been trying to capture a video of it for a while. It very
> frustrating the windows moving to the bottom on their own.

Forgot to add
Plasma 6.1.3
Frameworks 6.4.0
QT 6.7.2
Kernel 6.9.10
Comment 4 Nathan 2024-08-03 11:59:32 UTC
It is a really distracting bug having the window moving to the bottom on its own. I have now disabled floating panel and all is well.
Comment 5 Leandro Guedes 2024-09-12 18:17:15 UTC
I can reproduce it, I thought that changing the vbox to qt6 would solve it, but the same behavior continues.

VirtualBox: 7.1.0r164728
Qt Version: Qt6.7.2

Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.9-zen1-2-zen (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-3570 CPU @ 3.40GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2
Comment 6 Vlad Zahorodnii 2024-09-24 13:58:31 UTC
Can you make a screencast showing the issue please? There's a high chance that this issue might have been fixed in 6.2 because there were some floating panel changes.
Comment 7 Leandro Guedes 2024-09-24 15:30:12 UTC
Created attachment 174031 [details]
VirtualBox window "walking" when another window belonging to vbox touches and changes the state of the panel.
Comment 8 Vlad Zahorodnii 2024-09-24 23:37:57 UTC
Aha, I see! I can reproduce it, thank you!
Comment 9 Vlad Zahorodnii 2024-09-25 00:33:54 UTC
I looked into the issue and it seems virtualbox moves itself by the amount of the titlebar height. My guess is that virtualbox uses the global window coordinates but it either mishandles reparenting window managers (kwin is one of them) or its _NET_FRAME_EXTENTS handling is broken.

As a workaround, you could go to X11 session and create an "ignore requested geometry" window rule and then return back to Wayland session. https://invent.kde.org/plasma/kwin/-/merge_requests/6488 makes the window rule visible when you're running Wayland session, so you don't need to switch between sessions back and forth. You could also disable window borders for oracle: right click the deco and select "no titlebar and frame" in "more actions".

Could somebody report this issue to VirtualBox developers please? I don't think that we can do anything about it, VirtualBox asks KWin to be moved and the latter honors the request.
Comment 10 David Edmundson 2024-10-13 18:08:21 UTC
*** Bug 494677 has been marked as a duplicate of this bug. ***
Comment 11 Sergio 2024-10-13 20:56:47 UTC
Reported to VirtualBox as https://www.virtualbox.org/ticket/22204.  The 7.1.2 version has just been released, so even if it is for the next cycle, I do not know how fast a fix will come.