Bug 479901 - Loss of focus when toggling ON/OFF the monitor
Summary: Loss of focus when toggling ON/OFF the monitor
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: git-stable-Plasma/5.27
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, usability
Depends on:
Blocks:
 
Reported: 2024-01-16 15:19 UTC by Éric Bisson
Modified: 2024-05-28 17:56 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Éric Bisson 2024-01-16 15:19:04 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Focus is not preserved when restoring a screen state for an application. The use case I have is the following: Kiosk PC used with a TV monitor and a remote controller. It has kodi in full screen, when I close the TV and re-open it, focus is lost and kodi appear behind the task bar (still in full screen) and input is not captured. When looking at the logs, when I power off the TV, it disable the hdmi completely so the same as unplugging the tv. Model of the TV is a LG OLED C2. The same issue happens when switching when using a KVM switch and toggling between PCs.

STEPS TO REPRODUCE
1. Open a full screen application
2. Unplug your monitor
3. Re-plug your monitor
4. Focus is being lost

OBSERVED RESULT
When powering OFF and ON my TV, my fullscreen application lose its focus

EXPECTED RESULT
When powering OFF and ON my TV, I want the screen to stay as it was before

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: OpenSUSE Tumbleweed
(available in About System)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12

ADDITIONAL INFORMATION
Comment 1 Zamundaaa 2024-01-16 16:17:06 UTC
Can confirm, the desktop window gets focused when it shouldn't be.
Comment 2 Zamundaaa 2024-05-28 17:56:13 UTC
This has been fixed with https://invent.kde.org/plasma/kwin/-/merge_requests/4349