[plasma/kwin/Plasma/6.7] src: x11window: also take screen locking and dpms into account for visibility
Xaver Hugl <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit fbc92d058577b02667b9c5aa6b634ef0cd2d6733 by Xaver Hugl.
Committed on 27/07/2026 at 11:43.
Pushed by zamundaaa into branch 'Plasma/6.7'.
x11window: also take screen locking and dpms into account for visibility
Many games break when they get throttled too much, which so far happened when
the screen is locked or dpms off.
For screen locking, this only sets the window to "keep" mode, since the flicker
that happens when some X11 apps get mapped again is quite visible there.
For dpms off though, the modeset time and animations ensure you can't see that
flicker, so we can unmap the window completely. Well-behaved apps should then
stop rendering until the screen is turned on again.
(cherry picked from commit a0d90f1fdc201f77571e44dfedc505726d932484)
M +4 -2 src/x11window.cpp
https://invent.kde.org/plasma/kwin/-/commit/fbc92d058577b02667b9c5aa6b634ef0cd2d6733
diff --git a/src/x11window.cpp b/src/x11window.cpp
index 95a2c51314b..7bc8fec0546 100644
--- a/src/x11window.cpp
+++ b/src/x11window.cpp
@@ -136,6 +136,8 @@ X11Window::X11Window()
connect(clientMachine(), &ClientMachine::localhostChanged, this, &X11Window::updateCaption);
connect(options, &Options::condensedTitleChanged, this, &X11Window::updateCaption);
+ connect(workspace(), &Workspace::dpmsStateChanged, this, &X11Window::updateVisibility);
+ connect(waylandServer(), &WaylandServer::lockStateChanged, this, &X11Window::updateVisibility);
// SELI TODO: Initialize xsizehints??
}
@@ -1140,13 +1142,13 @@ void X11Window::updateVisibility()
return;
}
setSkipTaskbar(originalSkipTaskbar()); // Reset from 'hidden'
- if (isMinimized()) {
+ if (isMinimized() || workspace()->dpmsState() != Workspace::DpmsState::On) {
info->setState(NET::Hidden, NET::Hidden);
internalHide();
return;
}
info->setState(NET::States(), NET::Hidden);
- if (!isOnCurrentDesktop()) {
+ if (!isOnCurrentDesktop() || waylandServer()->isScreenLocked()) {
internalKeep();
return;
}