Bug 484155 - Defocused fullscreen apps sometimes continue to display over everything else
Summary: Defocused fullscreen apps sometimes continue to display over everything else
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.1.5
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 482912 494605 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-21 12:56 UTC by Nel
Modified: 2024-10-16 20:19 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1.4
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.