Bug 473971

Summary: Games do not display when Wayland fractional scaling is enabled
Product: [Plasma] kwin Reporter: Kyle McGrath <dualitykyle>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: kde, nate, xaver.hugl
Priority: NOR    
Version First Reported In: 5.27.7   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Kyle McGrath 2023-08-31 03:24:58 UTC
SUMMARY
If I have fractional scaling enable on Wayland, then launching a game using Lutris or Steam results in the game window not being displayed.

STEPS TO REPRODUCE
1. In a Wayland Plasma session, enable display scaling
2. Launch a game using Steam or Lutris

OBSERVED RESULT
When launching a game, I can see the game's icon in the taskbar, and I can hear the game's audio, but I continue to see my desktop and other windows. While the game window is active I can't click on anything else.

EXPECTED RESULT
The game should be displayed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kernel 6.4.12-200.fc38.x86_64
(available in About System)
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
Alt-tabbing allows me to select another window and interact with it. On certain games which change the cursor, I can see the game's skinned cursor.
Comment 1 Zamundaaa 2023-09-05 17:58:07 UTC
When this happens, can you check the buffer geometry of the X11 window with the kwin debug console? To open it, just search for "kwin" in krunner
Comment 2 Kyle McGrath 2023-09-06 01:50:17 UTC
(In reply to Zamundaaa from comment #1)
> When this happens, can you check the buffer geometry of the X11 window with
> the kwin debug console? To open it, just search for "kwin" in krunner

I did get the info you asked, but I also have some new info as well. I'll start with the new info.

I went and loaded the two games I previously used to test when I submitted the bug report (League of Legends via Lutris, and Crab Champions via Steam). They just worked without any intervention from me, or so I thought! By default my install was scaling my 2560x1600 screen to 150%, which is what I did the original tests with. But because I do some web design work as a hobby, I reduced the scaling to 135% to give me scaling that was fairly close to 1920X1200.

This reduced scaling has corrected the issue. My workaround was setting to simply 100% scaling, but it looks like anything at 135% or lower does allow the games to work normally and be visible. I went ahead and tested with 125%, 130%, 140%, 145%, and 150%. 125% and 130% work fine, but 140-150% produced the same bug.

Using the kwin debug you suggested, I couldn't first see the geometry, but got some strange behaviour when alt+tabbing the focus away from the game window, etc. in order to show the geometry. Since selecting the window caused the geometry window to disappear, I decided to just take a short video as this also shows the other weird behaviour. I've uploaded it to Google Drive, here's the link:

https://drive.google.com/file/d/1i96jW1khmc6p8OCGgeWEdkFuuKWwVNNL/view?usp=sharing

If any further info is required on my end please let me know and I'll be happy to get it for you!
Comment 3 Zamundaaa 2023-09-19 15:29:46 UTC
I have a laptop that has the same resolution as yours, and while CS:GO shows fine at 145% scale, I do get the same issue as you have with The Entropy Center.

With xorg-xwayland-git installed, the issue goes away, so this will be the caused by https://gitlab.freedesktop.org/xorg/xserver/-/issues/1540. If you want to wait until the next stable release reaches your distro, the fix will be in Xwayland 23.2