Bug 489090

Summary: Full Screen Apps Running in Proton Not Registering As Being in Full Screen
Product: [Plasma] kwin Reporter: Noah Westervelt <nwestervelt>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: linx.system.adm, nate, nwestervelt
Priority: NOR Keywords: wayland-only
Version First Reported In: 6.1.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.2.0
Sentry Crash Report:
Attachments: xprop output proton game

Description Noah Westervelt 2024-06-24 06:13:37 UTC
SUMMARY
Full screen apps running with Proton are not detected as full screen apps by kwin correctly. On Wayland, I suspect this prevents kwin from allowing tearing in these apps. On X11, this prevents kwin from automatically disabling the compositor when a full screen app is started.

Version of Proton Used: 8.0-5 (but seems to happen with other versions as well)

STEPS TO REPRODUCE
1. If on X11, allow applications to block compositing. If on Wayland, allow tearing in full screen apps.
2. Install a Windows game (tested with Steam and Lutris) , using Proton version 8.0-5 to run it.
3. Switch the game to full screen mode (if not already in full screen mode).

OBSERVED RESULT
Observe the compositor not being disabled if on X11, or stutters in game if on Wayland.

EXPECTED RESULT
If on X11, compositor being automatically disabled. If on Wayland, no stutters in game.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (Kernel 6.9.5-arch1-1(64-bit))
(available in About System)
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
I do not know for certain that these apps aren't being detected correctly as full screen apps when using Wayland, I just noticed that there was some stuttering in them on Wayland and that these same apps don't block compositing when run on X11. If there is a way I can check if kwin is allowing the screen to tear when these apps are running in full screen mode on Wayland, please let me know and I will update this with my findings.

There is a work around on X11 for this, manually toggling compositing. If there's no good way to fix this on Wayland, I think a similar toggle feature to allow tearing might be a good option.
Comment 1 Noah Westervelt 2024-06-24 06:20:13 UTC
It just occurred to me that this might be something not specific to apps running in Proton, but apps using XWayland (which I believe Proton uses).
Comment 2 Vlad Zahorodnii 2024-06-27 10:01:15 UTC
Tearing is supported only when using legacy modesetting api. By default, kwin uses atomic modesetting, which doesn't support tearing atm.

Regarding blocking compositor, please run xprop and click a game window.
Comment 3 Noah Westervelt 2024-06-28 02:22:05 UTC
Created attachment 171111 [details]
xprop output proton game

This is the xprop output I got after clicking on the game window for "EZ2ON REBOOT: R" while running X11. This is a Windows game, and it is running through Steam using Proton 8.0-5.
Comment 4 username 2024-07-18 13:56:27 UTC
I have the same problem. However I can only reproduce it since linux 6.10 and if using atomic modesetting.

If I set KWIN_DRM_NO_AMS=1 then issue is gone.
If I downgrade linux to 6.9.9 (can still have atomic modesetting), then issue is gone.

STEPS TO REPRODUCE
1) Make sure you using linux 6.10 and atomic modesetting is on
2) Set Adaptive sync to Automatic
3) Launch some proton game
4) Turn on display OSD and observe refresh rate. You can see that VRR is working, so KWin successfully detecting full screen. But not for long
5) Alt-tab from game to any application. Then alt-tab back
6) Look at the display OSD, you will see that VRR stopped working. I believe it means that KWin not detecting full screen anymore
Comment 5 username 2024-10-11 17:25:15 UTC
It looks like it's fixed in 6.2. I could not reproduce the issue anymore
Comment 6 Nate Graham 2024-10-11 20:21:49 UTC
Is it also fixed for you in Plasma 6.2, Noah?
Comment 7 Noah Westervelt 2024-10-12 08:43:04 UTC
(In reply to Nate Graham from comment #6)
> Is it also fixed for you in Plasma 6.2, Noah?

Seems like the issue of games stuttering under Wayland I reported has been resolved, which I suspected was the result of full screen apps not tearing under Wayland. This one is hard to say for sure, it just feels like apps are tearing when they're supposed to now.

The issue of Proton / WINE games not blocking compositing automatically under X11 still occurs though. This issue isn't a huge problem though because you can manually stop compositing on X11.
Comment 8 Nate Graham 2024-10-16 17:43:46 UTC
Cool, that would actually be an app/game/Proton issue, not a KWin issue.