https://bugs.kde.org/show_bug.cgi?id=457096

            Bug ID: 457096
           Summary: Screen hangs when losing focus and refocusing
                    fullscreen app/game while USB-C external monitor is
                    set as primary monitor on laptop
           Product: kwin
           Version: 5.25.3
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: multi-screen
          Assignee: kwin-bugs-n...@kde.org
          Reporter: ready2rum...@tutanota.com
  Target Milestone: ---

Created attachment 150884
  --> https://bugs.kde.org/attachment.cgi?id=150884&action=edit
Kscreen files

SUMMARY
Hey there,

I'm using a laptop with Fedora KDE running Plasma 5.25.3 (Wayland) and an AMD
CPU and GPU (running Mesa 22.2.0-dev). From the tail end of the 5.24 releases,
up till 5.25.3, Kscreen was only detecting my external monitor. While this
is/was a bug, my laptop is tethered to power and I only use the external screen
anyway.

After experiencing a power cut while in use, my external monitor powered off
and the laptop monitor became the primary display. Since then, Kscreen is
detecting both the laptop and external monitor. At this point, I configured
Kscreen to have the laptop monitor disabled and the external as the sole,
primary functioning monitor.

What I noticed when running games full-screen is that if it loses focus for
whatever reason, whether it be a background notification or I alt+tab, the game
screen hangs with the last image that was showing before re-focusing. If I
alt+tab to another app window or the KDE app switcher shows, I can see the game
running fine but the moment I re-focus on the game window, the image/screen
freezes. This does not occur when running the game windowed.

To troubleshoot further, I experimented with enabling just the laptop screen,
just the external screen and both with either set to 'Primary'. From my
testing, this issue occurs specifically when the external monitor is set as
primary (whether the laptop screen is enabled or disabled). Assuming it might
be an issue with the kscreen entries, I deleted everything in
.local/share/kscreen and rebooted. Despite the refreshed listing of both
monitors, the symptom persists.

The last tinkering I did was to test removing the laptop screen file in the
'output' folder and editing the main file in the root of the kscreen folder, to
purge recognition of the laptop screen entirely. After rebooting, kscreen was
detecting only the external monitor and it was set to primary. In this
instance, not only were fullscreen games still having the same issue but now
the desktop environment was too. I'd have to alt+tab, expose the KDE app
switcher and the desktop was responsive again.

More specifically concerning the desktop, I would be moving the mouse cursor
around and the desktop would "freeze" after a few seconds of movement (only
alt-tabbing would "wake" it up). I'd alt+tab, move the mouse around and it
would hang again. Curious about this, I eventually alt+tabbed and navigated the
desktop with just the keyboard...and it didn't hang.

So not only is this hanging occurring when losing focus and refocusing
fullscreen games but mouse movement (also) triggers the desktop environment to
behave in the same way whilst the laptop screen entries in Kscreen are purged.
As long as kscreen detects the laptop screen as well, the desktop environment
runs fine without mouse movement triggering any hangs. Lastly, mouse movement
in the game itself doesn't cause any hanging (whether kscreen entry detects the
laptop screen or not).



STEPS TO REPRODUCE
1. Run KDE 5.25.3 w/ Wayland on a laptop with an external screen via USB-C
(preferably an AMD GPU w/ Mesa 22.2.0-dev)
2. Set external monitor as 'Primary' in Kscreen (with laptop screen enabled or
disabled)
3. Run GPU accelerated app full-screen (any game will do), alt+tab and attempt
to refocus on the game window.
4. For deeper testing, delete laptop screen entry in Kscreen/Output and edit
file in root Kscreen folder to purge the laptop screen entry. Reboot and
re-test games with alt-tabbing and refocusing & move mouse cursor on the
desktop.

OBSERVED RESULT
While the external monitor is set as 'Primary', losing focus on the full-screen
game will cause the game process to only show the last frame when refocused. If
Kscreen entries are modified to purge the laptop screen, the issue persists
with fullscreen games & it's also triggered on the desktop environment itself
when moving the mouse cursor around  consistently for a few seconds. Navigating
with the keyboard does not induce the symptom.

EXPECTED RESULT
Full-screen games should operate & display properly, without freezing, when
losing and regaining focus while the external monitor is set as primary
(whether laptop monitor is enabled or disabled). More-so, the desktop
environment should operate properly, without the same type of freezing
(triggered by mouse movement) while laptop screen entry is purged from Kscreen.

SOFTWARE/OS VERSIONS
Linux: Fedora 36 KDE
KDE Plasma Version:  5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
Attached is the contents of the kscreen folder, if it will help in any way.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to