Bug 475318 - Often unable to open application menu, access taskbar, or switch away from XWayland full screen window
Summary: Often unable to open application menu, access taskbar, or switch away from XW...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.27.8
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-07 13:14 UTC by Stephane Travostino
Modified: 2023-12-09 19:38 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane Travostino 2023-10-07 13:14:25 UTC
SUMMARY

9 times out of 10, if I'm in a fullscreen application, pressing the Windows button/Alt+F1 to open the menu and access the dashboard does not work. 

Repeatedly mashing the Windows button might help. Also, pressing Alt-Tab works, but switching to any app is impossible 9 times out of 10. Only by trying to repeatedly switch away to another app the request might finally succeed.

On the best of days, with the same application and condition, switching works as expected and is always possible.

STEPS TO REPRODUCE
1. Open a fullscreen app (ie. game)
2. Press the Windows button/Alt-F1

OBSERVED RESULT

Nothing happens 9 times out of 10

EXPECTED RESULT

Menu is opened, taskbar is shown.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Latest on Fedora Kinoite


ADDITIONAL INFORMATION

I'm almost certain this is a regression from the past few months. I never encountered any issues with this earlier this year.
Comment 1 Nate Graham 2023-10-11 21:36:58 UTC
What apps are you seeing this in? Is it one game, or just a few games? Can you also reproduce it with the Full Screen mode in Firefox?

Are you using X11 or Wayland?
Comment 2 Stephane Travostino 2023-10-12 08:49:25 UTC
I have experienced in RuneLite (from Flathub), which I manually force to fullscreen using custom KWin window settings. I couldn't say if it happens anywhere else, because I don't have access to KDE for a few weeks, and in GNOME the issue is not present at all.

On Wed, 11 Oct 2023, at 22:36, Nate Graham wrote:
> https://bugs.kde.org/show_bug.cgi?id=475318
>
> Nate Graham <nate@kde.org> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>            Assignee|plasma-bugs@kde.org         |kwin-bugs-null@kde.org
>             Product|plasmashell                 |kwin
>          Resolution|---                         |WAITINGFORINFO
>              Status|REPORTED                    |NEEDSINFO
>           Component|general                     |general
>                  CC|                            |nate@kde.org
>    Target Milestone|1.0                         |---
>
> --- Comment #1 from Nate Graham <nate@kde.org> ---
> What apps are you seeing this in? Is it one game, or just a few games? Can you
> also reproduce it with the Full Screen mode in Firefox?
>
> Are you using X11 or Wayland?
>
> -- 
> You are receiving this mail because:
> You reported the bug.
Comment 3 Nate Graham 2023-10-12 21:59:56 UTC
Ok. Can you test again in an app that natively supports full screen mode, like Firefox or Gwenview? I suspect that your window rule is the cause of the issue, perhaps because you used the "force" setting rather than "apply initially".
Comment 4 Stephane Travostino 2023-10-13 09:50:41 UTC
Just tested again, on a fresh KDE (Fedora Kinoite). The app is forced fullscreen with "Apply Initially" and after a few minutes of playing the game, pressing the Windows key to open the menu works very intermittently. It's like there's some kind of race condition, and only rarely the command goes through.

I can't seem to replicate with Firefox, but that's a well-behaved Wayland app, the one I'm having issues with, Runelite, is a crappy Java app on XWayland.

On Thu, 12 Oct 2023, at 22:59, Nate Graham wrote:
> https://bugs.kde.org/show_bug.cgi?id=475318
>
> --- Comment #3 from Nate Graham <nate@kde.org> ---
> Ok. Can you test again in an app that natively supports full screen mode, like
> Firefox or Gwenview? I suspect that your window rule is the cause of the issue,
> perhaps because you used the "force" setting rather than "apply initially".
>
> -- 
> You are receiving this mail because:
> You reported the bug.
Comment 5 Stephane Travostino 2023-10-13 14:48:47 UTC
Just experienced the same issue playing Darkwood, a Proton game. If I press alt-tab, the switcher appears and immediately goes away. After a dozen times, alt-tab works, and the Windows key works from the game, opening the menu. 

It's like it breaks after an app has been fullscreen for a while. 

On Fri, 13 Oct 2023, at 10:50, Stephane Travostino wrote:
> Just tested again, on a fresh KDE (Fedora Kinoite). The app is forced 
> fullscreen with "Apply Initially" and after a few minutes of playing 
> the game, pressing the Windows key to open the menu works very 
> intermittently. It's like there's some kind of race condition, and only 
> rarely the command goes through.
>
> I can't seem to replicate with Firefox, but that's a well-behaved 
> Wayland app, the one I'm having issues with, Runelite, is a crappy Java 
> app on XWayland.
>
> On Thu, 12 Oct 2023, at 22:59, Nate Graham wrote:
>> https://bugs.kde.org/show_bug.cgi?id=475318
>>
>> --- Comment #3 from Nate Graham <nate@kde.org> ---
>> Ok. Can you test again in an app that natively supports full screen mode, like
>> Firefox or Gwenview? I suspect that your window rule is the cause of the issue,
>> perhaps because you used the "force" setting rather than "apply initially".
>>
>> -- 
>> You are receiving this mail because:
>> You reported the bug.
Comment 6 Nate Graham 2023-10-13 19:37:46 UTC
Can you open up the ~/.config/kwinrulesrc file, find the entry for the window rule that's forcing one of the problematic windows to be fullscreen, and copy-and-paste it into here?
Comment 7 Stephane Travostino 2023-10-13 19:47:19 UTC
The issue I have with RuneLite is with forced window rules, the one with Darkwood is regular game fullscreen mode.

In any case, here it is:

```
[$Version]
update_info=kwinrules.upd:replace-placement-string-to-enum,kwinrules.upd:use-virtual-desktop-ids

[02c47812-75a8-4cc1-a20c-8cb86eb38c2a]
Description=Window settings for net-runelite-client-runelite
clientmachine=localhost
noborder=true
noborderrule=3
title=RuneLite
titlematch=1
types=1
wmclass=net-runelite-client-runelite
wmclassmatch=1

[1]
Description=Window settings for net-runelite-client-runelite
clientmachine=localhost
fullscreen=true
fullscreenrule=3
title=RuneLite
titlematch=1
types=1
wmclass=net-runelite-client-runelite
wmclassmatch=1

[General]
count=1
rules=1
```

On Fri, 13 Oct 2023, at 20:37, Nate Graham wrote:
> https://bugs.kde.org/show_bug.cgi?id=475318
>
> Nate Graham <nate@kde.org> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>           Component|general                     |rules
>             Summary|Often unable to open        |Often unable to open
>                    |application menu, access    |application menu, access
>                    |taskbar or switch away from |taskbar, or switch away
>                    |fullscreen application.     |from window forced into
>                    |                            |full screen mode using
>                    |                            |Window Rules
>                  CC|                            |isma.af@gmail.com
>
> --- Comment #6 from Nate Graham <nate@kde.org> ---
> Can you open up the ~/.config/kwinrulesrc file, find the entry for the window
> rule that's forcing one of the problematic windows to be fullscreen, and
> copy-and-paste it into here?
>
> -- 
> You are receiving this mail because:
> You reported the bug.
Comment 8 Nate Graham 2023-10-16 17:04:47 UTC
Thanks for the info.

Ismael, any ideas here?
Comment 9 Ismael Asensio 2023-10-16 18:28:32 UTC
(In reply to Nate Graham from comment #8)
> Thanks for the info.
> 
> Ismael, any ideas here?

I'm trying to reproduce the issue. IIUC this happens on Wayland but only with some XWayland windows, right?

IMHO (by the report explanations) this has more to do with focus stealing  and fullscreen shenanigans between XWayland and Plasma windows, than rules themselves (rules are just the way for the app to get fullscreen), specially if some other app can be fullscreen without them.
Comment 10 Ismael Asensio 2023-10-16 18:48:25 UTC
Unfortunately trying to run RuneLite crashes my (admitedly flaky currently) dev kwin instance. 

However I could reproduce it sporadically with supertuxkart \o/, simply by turning it fullscreen via the window menu.

Stephane, can you try to reproduce the issue without setting the rule on RuneLite, but via the window menu (Alt+F3 -> More Actions -> Fullscreen)? This can help to better pinpoint the scope of the bug.

Thanks!!
Comment 11 Stephane Travostino 2023-10-17 08:15:44 UTC
I don't have access to KDE for a while, but as I mentioned previously, it's not strictly related to window rules: it happened in the game Darkwood which was set fullscreen from the game options.

So the original title was correct: this issue happens on fullscreen window, whether they're forced with window rules, or through in-app methods. 

And it is sporadic as I mentioned. Very empirically, immediately after starting the app the issue doesn't present, but after a while (minutes) pressing Win or Alt-Tab switches away for a split second before returning to the application. It takes a dozen tries to be able to switch away this way, and then everything is fine until it breaks again. It feels like there's a race between the window and Plasma to get focus, and 9 times out of 10 the app wins.

On Mon, 16 Oct 2023, at 19:48, Ismael Asensio wrote:
> https://bugs.kde.org/show_bug.cgi?id=475318
>
> --- Comment #10 from Ismael Asensio <isma.af@gmail.com> ---
> Unfortunately trying to run RuneLite crashes my (admitedly flaky currently) dev
> kwin instance. 
>
> However I could reproduce it sporadically with supertuxkart \o/, simply by
> turning it fullscreen via the window menu.
>
> Stephane, can you try to reproduce the issue without setting the rule on
> RuneLite, but via the window menu (Alt+F3 -> More Actions -> Fullscreen)? This
> can help to better pinpoint the scope of the bug.
>
> Thanks!!
>
> -- 
> You are receiving this mail because:
> You reported the bug.
Comment 12 Stephane Travostino 2023-10-21 16:50:53 UTC
I think the issue at play here is the fact that it is very hard (i.e. takes a lot of tries) to open a window in front of a fullscreen XWayland one. 

For example, if I'm in a fullscreen game, and I start a program, it takes a dozen tries to bring it on top, as for some reason KWin always switches back to the game no matter what I do. It is rarely possible to make it work, but it's a matter of chance. I tried to replicate the same issue with Firefox (which is running via Wayland) and it behaves as intended, whereas any Steam game does NOT. You literally should be able to reproduce this with any fullscreened game.

I reckon this bug is the exact same thing: the Application menu might be opened, but for some reason KWin immediately switches back to the game.
Comment 13 Jonathan Isom 2023-12-09 19:38:07 UTC
I am seeing this on 6.0 Beta1.  If I have first login I can use the Application Menu or Application Launcher.  If I open vlc and play a video and it is as a window it continues to work.  As soon as I make that window fullscreen and exit fullscreen I can't open those menus.  The icon in the dock will change to indicate that it was clicked but they don't show up.  Closing all the Xwayland windows does not resolve this and I tried killing Xwayland, but that just killed(Firefox's crash reporter showed) all my open programs and restart kwin.

Operating System: Arch Linux 
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Kernel Version: 6.6.4-273-tkg-linux-tkg (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4080/PCIe/SSE2
Product Name: X570M Pro4