Bug 483162 - Sometimes wrong window stacking stacking orders with NVIDIA and AMD GPUs
Summary: Sometimes wrong window stacking stacking orders with NVIDIA and AMD GPUs
Status: RESOLVED DUPLICATE of bug 478556
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.0.1
Platform: Arch Linux Linux
: NOR grave
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-10 19:45 UTC by Gladox114
Modified: 2024-04-18 20:52 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screencast showing the problem with Android Studio on Intel (960.64 KB, video/mp4)
2024-04-10 13:42 UTC, Oded Arbel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gladox114 2024-03-10 19:45:21 UTC
SUMMARY
All my Windows are randomly going over the other when unfocused, and the focused one sometimes goes to the very behind or in the middle somewhere.


STEPS TO REPRODUCE
1. Start and play Apex Legends with Proton Hotfix
2. Start and use Cura Ultimaker 5.6.0 from Flatpak
3. Wait for some time.
4. See windows go below other windows when focused.

OBSERVED RESULT
Having the newest window behind the second newest (in other words, having the current clicked window behind the window that is 1 click older).
Some Windows stay below all windows for some weird reason, like Spotify did. Meaning that the stacking order is not reversed, but random?
Even the shutdown screen where I can log out, sleep etc. is going behind all Windows.

EXPECTED RESULT
Have the focused window, the top window.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux, Plasma 6.0.1 Wayland
(available in About System)
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
Comment 1 Znshje 2024-03-11 10:31:10 UTC
My desktop environment with plasma-x11 (6.0.1) also has the same problem
Comment 2 Nate Graham 2024-03-11 20:17:45 UTC
Does the issue still happen in a new clean user account?
Comment 3 Znshje 2024-03-12 02:08:54 UTC
(In reply to Nate Graham from comment #2)
> Does the issue still happen in a new clean user account?

Yes, it still exists. I don't have the same applications as @glados9999, so my procedure is different from his/her. In the new clean account, I start a PyCharm process, a microsoft-edge process, a Dolphin window, and a Kate window, as a normal working environment. The issue happens when I have done some text editing works and raised some pop-up dialogs. The first wierd behaviour is that when I right-click the Task Manager, the mouse click event propagates to the desktop and pops up the desktop context menu, rather than the Task Manager's. My computer has two monitors, with NVIDIA 550.54.14 driver, btw.

The issue cannot be reproduced consistently for me in a short time. However, after a relatively longer period of time (with many user interactions), the problem will appear almost steadily.

Is there any other information we can provide, or operations we can perform, to help you diagnose the issue?
Comment 4 Nate Graham 2024-03-13 18:42:28 UTC
Thanks. My mind immediately blamed NVIDIA, but I have no direct evidence. It *feels* like a GPU driver issue though.

Any chance you could test again with only one monitor, and then again when it's plugged into something that's not an NVIDIA GPU, if possible?
Comment 5 Gladox114 2024-03-13 18:46:18 UTC
(In reply to Nate Graham from comment #4)
> Thanks. My mind immediately blamed NVIDIA, but I have no direct evidence. It
> *feels* like a GPU driver issue though.
> 
> Any chance you could test again with only one monitor, and then again when
> it's plugged into something that's not an NVIDIA GPU, if possible?

My setup used an AMD 7650xt with two monitors. I could try with a single monitor.
Comment 6 Gladox114 2024-03-16 14:47:53 UTC
Well, I meant AMD 6750 XT

I tried with a single Monitor only. Plugged all cables out. Started Cura, Started Apex Legends and as soon as I start Apex Legends, my always visible panel comes to front even tho the game is fullscreen. Putting it on a second Desktop (The feature with multiple workspaces), the Panel goes behind the game, but all glitches start to happen because all windows just go randomly above and under each other when trying to focus them.
Comment 7 Nate Graham 2024-03-18 22:01:37 UTC
Thanks for the info.
Comment 8 Zamundaaa 2024-03-18 23:07:06 UTC
Do you have the "slide back" effect enabled?
Comment 9 Znshje 2024-03-19 01:33:30 UTC
(In reply to Zamundaaa from comment #8)
> Do you have the "slide back" effect enabled?

Regardless of whether the effect is enabled or disabled, the mouse-click event passthrough problem persists. The window stacking order observed from the KDE debug console seems correct however (not sure, because the console became unfocusable due to this problem, and I coundn't do more checks), i.e., the top rendered window has the greatest stacking order, but mouse events will pass through to a window (or Desktop) with smaller stacking order.
Comment 10 Stefan Burnicki 2024-03-20 08:20:04 UTC
I'm experiencing the same with kwin 6.0.2 on KDE KDE neon, with both X11 and Wayland. Feels like it would appear more often with Wayland, but that could also be a wrong feeling. I'm having a laptop with AMD graphics:
Processors: 16 × AMD Ryzen 7 PRO 4750U with Radeon Graphics
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO

I mostly observe this happening with IntelliJ IDEA and not with KDE apps. I'm not enough into the technical details to know how these applications differ, I just can say that IntelliJ has it's own window decoration. And I *think* there was one time where the click would go through the window but I was able to resize it which also fixed the stack.

If there are any symptoms I can keep an eye on which would help to somehow narrow down the problem, I'm happy to provide it.
Comment 11 Oded Arbel 2024-04-10 13:42:05 UTC
Created attachment 168343 [details]
Screencast showing the problem with Android Studio on Intel

I can currently reproduce the problem with an Intel display on my laptop, with Android Studio (a variant of IntelliJ), running on Neon testing.

My setup:
Operating System: KDE neon Testing Edition
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.6.3
Kernel Version: 6.5.0-26-generic (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Comment 12 Oded Arbel 2024-04-10 13:46:57 UTC
(In reply to Oded Arbel from comment #11)
> I can currently reproduce the problem with an Intel display on my laptop,
> with Android Studio (a variant of IntelliJ), running on Neon testing.

After switching activities and virtual desktops (to file this report and talk to people on other channels), now Android Studio behaves normally again - I didn't restart anything, apparently it just comes and goes.
Comment 13 Gladox114 2024-04-14 15:13:56 UTC
For me, it always triggers this bug with Apex Legends. There is not a single moment when it doesn't trigger this bug.
Comment 14 Znshje 2024-04-14 15:26:07 UTC
These days I have tried a clean ArchLinux install (2024.04) on a new storage, and install KDE 6 desktop environment directly, rather than upgrading from KDE 5. The bug hasn't shown up yet.

It is strange that the bug exists on my old system (KDE upgraded from 5 to 6), even with a newly created user, but the newly installed system seems not affected. I'm not sure if any configurations or programs unrelated to the user's home directory cause the problem. Maybe you can try on a clean installed system if possible, and check if the problem still happens.
Comment 15 Znshje 2024-04-15 08:17:43 UTC
(In reply to jshazsj from comment #14)
> These days I have tried a clean ArchLinux install (2024.04) on a new
> storage, and install KDE 6 desktop environment directly, rather than
> upgrading from KDE 5. The bug hasn't shown up yet.
> 
> It is strange that the bug exists on my old system (KDE upgraded from 5 to
> 6), even with a newly created user, but the newly installed system seems not
> affected. I'm not sure if any configurations or programs unrelated to the
> user's home directory cause the problem. Maybe you can try on a clean
> installed system if possible, and check if the problem still happens.

:( I'm very sorry about this comment that the problem still exists on my newly installed ArchLinux, but the chances of the problem occurring are lower than before, to the extent that the issue has not been fully observed in my environment, even though it does exist.

Mine environment and operations are similar as @Oded Arbel to reproduce the problem. Besides, JetBrains IDEs decreas the frame rate of my desktop UI, which is annoying too.
Comment 16 Zamundaaa 2024-04-16 23:02:01 UTC

*** This bug has been marked as a duplicate of bug 478556 ***