[plasma/kwin/Plasma/6.6] src/scene: scene/windowitem: also set suspended state for dpms off
Xaver Hugl <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 6ffa7672d50ca8fd10ebe42ea15fc40d0d35168f by Xaver Hugl.
Committed on 27/07/2026 at 11:44.
Pushed by zamundaaa into branch 'Plasma/6.6'.
scene/windowitem: also set suspended state for dpms off
Rendering with the screen off is usually just a big waste of power.
(cherry picked from commit bb3d6d12440180a0502fb124bec00e6f36d0b80b)
M +3 -1 src/scene/windowitem.cpp
https://invent.kde.org/plasma/kwin/-/commit/6ffa7672d50ca8fd10ebe42ea15fc40d0d35168f
diff --git a/src/scene/windowitem.cpp b/src/scene/windowitem.cpp
index f2a48f76cb0..e06ae1a3521 100644
--- a/src/scene/windowitem.cpp
+++ b/src/scene/windowitem.cpp
@@ -51,6 +51,7 @@ WindowItem::WindowItem(Window *window, Item *parent)
connect(waylandServer(), &WaylandServer::lockStateChanged, this, &WindowItem::updateVisibility);
connect(workspace(), &Workspace::currentActivityChanged, this, &WindowItem::updateVisibility);
connect(workspace(), &Workspace::currentDesktopChanged, this, &WindowItem::updateVisibility);
+ connect(workspace(), &Workspace::dpmsStateChanged, this, &WindowItem::updateVisibility);
updateVisibility();
connect(window, &Window::opacityChanged, this, &WindowItem::updateOpacity);
@@ -191,7 +192,8 @@ void WindowItem::updateVisibility()
setVisible(visible);
if (m_window->readyForPainting()) {
- m_window->setSuspended(!visible && !m_window->isOffscreenRendering());
+ const bool dpmsOff = workspace()->dpmsState() != Workspace::DpmsState::On;
+ m_window->setSuspended((!visible || dpmsOff) && !m_window->isOffscreenRendering());
}
}