Bug 514828

Summary: Black screen after switching windows
Product: [Plasma] kwin Reporter: Argy M <argymeg>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: ASSIGNED ---    
Severity: grave CC: kdedev, nate, xaver.hugl
Priority: VHI    
Version First Reported In: 6.5.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 506893    
Attachments: kwin log via journalctl while reproducing the bug

Description Argy M 2026-01-19 12:55:26 UTC
Created attachment 188684 [details]
kwin log via journalctl while reproducing the bug

SUMMARY
When switching between windows (Alt + Tab), sometimes I get a black screen, and cannot recover from it except by killing kwin_wayland. This happens seemingly at random, and can easily be reproduced (on my system) by repeatedly pressing Alt + Tab for anywhere between 5 and 30 seconds - but also happens during regular usage. It seems to happen between any two windows (including native KDE apps), and also happens even if the windows are not overlapping or touching at all.

STEPS TO REPRODUCE
1. Open any two application windows
2. Repeatedly press Alt + Tab, for anywhere between 5 and 30 seconds.

OBSERVED RESULT
Black screen

EXPECTED RESULT
One should be able to continue switching between windows indefinitely.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
Kernel: 6.18.5-arch1-1
NVIDIA driver version: 580.126.09
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.2.2
Qt Version: 6.10.1

ADDITIONAL INFORMATION
I have not been able to reproduce this under X11.
I am attaching a kwin log, abridged for readability - the observed error messages flood the logs until kwin is killed.
I have tried to also produce a gdb trace but I can't seem to get debug symbols to work - I'm not sure if it would be useful as it's not a crash per se, let me know and I can try again again if necessary.
Comment 1 Zamundaaa 2026-01-19 14:31:09 UTC
> Jan 19 10:43:49 kelpie kwin_wayland[979]: QRhiGles2: Context is lost.
> Jan 19 10:43:49 kelpie kwin_wayland[979]: Failed to create RHI (backend 2)
> Jan 19 10:43:49 kelpie kwin_wayland[979]: Could not make egl context current! EGL_BAD_CONTEXT
That looks like the QPA context reset somehow deletes the normal EGL context. I can't think of a reason for why that would happen though, except maybe a bug in Qt.

Maybe KWin should consider being unable to make its context current the same as a GPU reset and rebuild everything from scratch. There's a good chance that would at least work around your problem.
Comment 2 Bug Janitor Service 2026-01-21 16:43:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8686