Bug 484155 - Defocused fullscreen apps sometimes continue to display over everything else
Summary: Defocused fullscreen apps sometimes continue to display over everything else
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.1.5
Platform: unspecified Linux
: HI normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
: 482912 494605 514889 517249 517259 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-21 12:56 UTC by Nel
Modified: 2026-04-24 19:38 UTC (History)
19 users (show)

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


Attachments
How to reproduce (2.15 MB, video/mp4)
2024-05-31 10:58 UTC, Oleh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nel 2024-03-21 12:56:29 UTC
SUMMARY
When an app is fullscreen it should be possible to press the meta key and defocus the app, have all panels (or just the panel the app launcher is in) and the app launcher display, and be able to use any task managers in the panels to focus other windows and use them temporarily before focusing the fullscreen window again. However this functionality seems very flaky/broken on plasma and most of the time doesn't work.

STEPS TO REPRODUCE
I unfortunately haven't been able to find any steps that always work because it's very opaque when this doesn't and doesn't get flaky in my experience though simply starting most any game and putting it in fullscreen will most of the time cause some sort of strange behaviour. If it's one of the lucky few times it does work right it usually stops working after a restart or two.

OBSERVED RESULT
Sometimes the panels and app launcher don't show up at all the fullscreen window just get unfocused. If the panels do show up using the task manager to switch to another window often results in that window flashing to the front and then being hidden back behind the fullscreen window immediately after.

EXPECTED RESULT
Hitting the meta key should always: defocus the currently focused window and show the application launcher and all panels (or at least the panel the application launcher is in). Choosing another window from any task managers in the shown panels should then focus that window and keep it at the top layer and focused until it'd defocused.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 39 KDE Spin
(available in About System)
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12

ADDITIONAL INFORMATION
I haven't checked if this happens under Xorg but it happens under Wayland on both my pc and my laptop. Both run the same version(s) of Fedora and Plasma
Comment 1 Nel 2024-03-22 14:09:21 UTC
After testing using the overview as a temporary fix as suggested by Zamundaaa <xaver.hugl@gmail.com> it seems changing focus to another window with the overview always works unlike the method described here.
Comment 2 Oleh 2024-04-11 11:51:07 UTC
I can confirm the issue, happens only under Wayland. The issue was in Plasma 5, and still persists in the latest Plasma 6.0.3. Another example, sometimes Spectacle selection may not appear in full-screen game.
Comment 3 Oleh 2024-05-24 06:08:46 UTC
This problem seems to reproduce only in games through XWayland. I cannot reproduce, for example, in Quake 2 RTX with SDL_VIDEODRIVER=wayland and games through gamescope
Comment 4 username 2024-05-30 22:14:08 UTC
I think is the same issue: https://www.reddit.com/r/kde/comments/1bwk5lb/alt_tabbing_junkiness_in_full_screen_apps_with/
Does unchecking "Click raises active window" in Window management > Window behavior helps?
Comment 5 Oleh 2024-05-31 10:58:27 UTC
Created attachment 170015 [details]
How to reproduce

(In reply to username from comment #4)
> I think is the same issue:
> https://www.reddit.com/r/kde/comments/1bwk5lb/
> alt_tabbing_junkiness_in_full_screen_apps_with/
> Does unchecking "Click raises active window" in Window management > Window
> behavior helps?

No, unchecking "Click raises active window" does nothing to this issue. 
I can reproduce 100% with these steps:

1. Run the game, but you should have no other active windows (only the window with the game)
2. Press Alt + Tab, you see 1 window with the game, release keys
3. Press Meta key, the game becomes defocused, but nothing appears over the game
Comment 6 Bug Janitor Service 2024-07-28 15:29:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6175
Comment 7 Zamundaaa 2024-07-29 11:41:28 UTC
Git commit d01e20b6a9b455c209fea0e1e4eba7976a8a051f by Xaver Hugl.
Committed on 29/07/2024 at 11:15.
Pushed by zamundaaa into branch 'master'.

activation: don't add the active window to should_get_focus list

The matching X11 focusIn event will never arrive, and so the window is stuck
in the list and messes with activation until it's no longer the active window
and then active later again

M  +4    -0    src/activation.cpp

https://invent.kde.org/plasma/kwin/-/commit/d01e20b6a9b455c209fea0e1e4eba7976a8a051f
Comment 8 Zamundaaa 2024-07-29 12:53:02 UTC
Git commit f509ff21c1c74e1e345ec56d6b41bb57d01ccd54 by Xaver Hugl.
Committed on 29/07/2024 at 11:44.
Pushed by zamundaaa into branch 'Plasma/6.1'.

activation: don't add the active window to should_get_focus list

The matching X11 focusIn event will never arrive, and so the window is stuck
in the list and messes with activation until it's no longer the active window
and then active later again


(cherry picked from commit d01e20b6a9b455c209fea0e1e4eba7976a8a051f)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +4    -0    src/activation.cpp

https://invent.kde.org/plasma/kwin/-/commit/f509ff21c1c74e1e345ec56d6b41bb57d01ccd54
Comment 9 Zamundaaa 2024-10-04 12:39:08 UTC
*** Bug 482912 has been marked as a duplicate of this bug. ***
Comment 10 Alex Folland 2024-10-04 12:58:18 UTC
I am running KWin version 6.1.5 which I believe has the committed fix from August 5th, and I still see this issue as I described today in my comment in the above-linked duplicate issue ticket.
Comment 11 Zamundaaa 2024-10-04 14:19:25 UTC
Most of the games I have automatically minimize on alt+tab, but Spider-Man Remastered doesn't, and the issue doesn't happen for me anymore.
Do you have any other games where this happens?
Comment 12 Alex Folland 2024-10-04 20:58:25 UTC
Yes.  I can reproduce it right now with the following games:

- Twilight Survivors (only when set to "fullscreen" instead of "borderless fullscreen")
- Yume Nikki

For the record, I just tested the following games that it was happening with recently and I could no longer reproduce it in them, so I think something has improved:

- Dragon Quest Heroes II
- Dragon Quest XI S: Definitive Edition
- Dragon Quest Monsters: The Dark Prince

I believe Yume Nikki is an RPG Maker game, so I expect the issue may happen with other RPG Maker games.

Yume Nikki is a free download on Steam, so that may be easy to test with.  I found it by looking for free games in my library and running various ones to test the issue.
Comment 13 Zamundaaa 2024-10-16 19:13:42 UTC
*** Bug 494605 has been marked as a duplicate of this bug. ***
Comment 14 Daktyl 2024-10-16 20:19:33 UTC
I can reproduce this bug on the latest Plasma 6.2.0 release using the game Throne and Liberty.
Comment 15 Vlad Zahorodnii 2026-01-20 13:17:09 UTC
Focus and stacking bits will be reworked in 6.6. It'll be great if people could test beta and confirm whether the issue is gone. There were a few code paths where kwin failed to update the stacking order.
Comment 16 TraceyC 2026-01-21 18:03:17 UTC
*** Bug 514889 has been marked as a duplicate of this bug. ***
Comment 17 TraceyC 2026-01-21 18:05:52 UTC
The summary in the duplicate bug indicates this has caused problems in the beta 6.5.90

Quoting
=====
SUMMARY
This is a very inconsistent behavior that started happening after updating to Plasma 6.5.90, back in 6.5.5 it was consistent and predictable, it is kinda hard to reproduce this, but, I observed this more easily with some fullscreen windows, sometime games, like Minecraft, Overwatch, or even watching videos on Firefox

STEPS TO REPRODUCE
1. Update to 6.5.90
2. Put an application or game in fullscreen
3. Try to open another window from another monitor in the main monitor

OBSERVED RESULT
When trying to open a window from the task manager or with Super + 1, 2, 3 etc... it opens but it doesn't come to the front, it is focused on the back but the fullscreen window doesn't come to the front, and I can see that is working and that is focused with another monitor, I experienced this most recently with Minecraft in fullscreen, I was trying to open Firefox (That was already opened on the main monitor) from my second monitor and it was not opening, after some time clicking it opened for some reason  

EXPECTED RESULT
The application should open immediately after clicking or given the input to, it was like that on 6.5.5

=====
Comment 18 Simon Ra 2026-02-20 17:39:43 UTC
Since 6.6 this is happening consistently for me, with the following STR:

1) On my primary screen, which has an application launcher panel, full-screen a firefox video.
2) On my secondary screen, which has *no* application launcher, focus any window.
3) Press the Meta/Super key, which should bring up the application launcher panel on the primary screen.

Expected: see the application launcher after one Meta key press
Observed: application launcher does not appear until the third Meta key press
Comment 19 Oxygel 2026-02-27 11:47:13 UTC
(In reply to Simon Ra from comment #18)
> Since 6.6 this is happening consistently for me, with the following STR:
> 
> 1) On my primary screen, which has an application launcher panel,
> full-screen a firefox video.
> 2) On my secondary screen, which has *no* application launcher, focus any
> window.
> 3) Press the Meta/Super key, which should bring up the application launcher
> panel on the primary screen.
> 
> Expected: see the application launcher after one Meta key press
> Observed: application launcher does not appear until the third Meta key press

I can also confirm the same issue on my side, I'm pretty sure it didn't happen since 6.6 and is still present in 6.6.1
I'm currently on the Wayland session with a 9070XT if that can help
I will also add that sometimes, when you have another window on the monitor where the fullscreen app is, alt tabbing into it won't bring it in front of the fullscreen app and will stay behind instead, forcing me to move it on another monitor in order to see it
Comment 20 xXdimmitsarasXx 2026-03-21 23:41:26 UTC
Since this thread seems more active i'll repost my comment:

The bug is a regression on activation.cpp caused by commit dd43d93ccf6c4cd8a4f322fd822c98c3d2893c35 https://github.com/KDE/kwin/commit/dd43d93ccf6c4cd8a4f322fd822c98c3d2893c35#diff-bd8da48fe5c152b894e487663ce4b14d2b2657980daf82f2ecb7328c38def6eb

Specifically lines 254-262 had logic catching this edge case of multiple monitors
// activating a client can cause a non active fullscreen window to loose the ActiveLayer status on > 1 screens
        if (outputs().count() > 1) {
            for (auto it = m_windows.begin(); it != m_windows.end(); ++it) {
                if (*it != m_activeWindow && (*it)->layer() == ActiveLayer && (*it)->output() == m_activeWindow->output()) {
                    (*it)->updateLayer();
                }
            }
        }

I built 6.6.2 locally just by adding this snippet back and got alt tabbing to work as intended.
Comment 21 Joaquim Monteiro 2026-04-20 10:21:16 UTC
I can confirm that reverting the mentioned change in src/activation.cpp does fix both alt-tabbing and using the application launcher (and its keyboard shortcuts) to focus windows.
Comment 22 Bug Janitor Service 2026-04-20 14:11:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/9115
Comment 23 Zamundaaa 2026-04-20 16:01:32 UTC
Git commit 82a020e3f27120ec77391902f6bec70ff900ff5c by Xaver Hugl.
Committed on 20/04/2026 at 14:44.
Pushed by zamundaaa into branch 'master'.

activation: restore code updating layers of fullscreen windows

It was removed because there's similar code in Window::setActive, but the code
in Window::setActive only updates the main window of the window itself, while
we actually need to update the layers of all fullscreen windows on all screens.

M  +9    -0    src/activation.cpp

https://invent.kde.org/plasma/kwin/-/commit/82a020e3f27120ec77391902f6bec70ff900ff5c
Comment 24 Prajna Sariputra 2026-04-20 16:26:52 UTC
*** Bug 517259 has been marked as a duplicate of this bug. ***
Comment 25 Zamundaaa 2026-04-21 01:33:14 UTC
Git commit 056cf1ce3da326ee1817336be4bec8015ebc817c by Xaver Hugl.
Committed on 21/04/2026 at 00:10.
Pushed by zamundaaa into branch 'Plasma/6.6'.

activation: restore code updating layers of fullscreen windows

It was removed because there's similar code in Window::setActive, but the code
in Window::setActive only updates the main window of the window itself, while
we actually need to update the layers of all fullscreen windows on all screens.


(cherry picked from commit 82a020e3f27120ec77391902f6bec70ff900ff5c)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +9    -0    src/activation.cpp

https://invent.kde.org/plasma/kwin/-/commit/056cf1ce3da326ee1817336be4bec8015ebc817c
Comment 26 Zamundaaa 2026-04-22 16:28:43 UTC
*** Bug 517249 has been marked as a duplicate of this bug. ***