[plasma/kwin] 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 bb3d6d12440180a0502fb124bec00e6f36d0b80b by Xaver Hugl.
Committed on 27/07/2026 at 10:26.
Pushed by zamundaaa into branch 'master'.

scene/windowitem: also set suspended state for dpms off

Rendering with the screen off is usually just a big waste of power.

M  +3    -1    src/scene/windowitem.cpp

https://invent.kde.org/plasma/kwin/-/commit/bb3d6d12440180a0502fb124bec00e6f36d0b80b

diff --git a/src/scene/windowitem.cpp b/src/scene/windowitem.cpp
index e20c71cc6fd..a530063dbcb 100644
--- a/src/scene/windowitem.cpp
+++ b/src/scene/windowitem.cpp
@@ -53,6 +53,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);
@@ -197,7 +198,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());
     }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.