From fb3018b711ac41c364ee83c5ea1e865a8b9c11bd Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 27 Mar 2023 02:11:37 +0200 Subject: [PATCH] dpms: Make sure we are not calling the interface after the output is gone It seems it's possible at times, as described in the bug. BUG: 466346 --- src/wayland/dpms_interface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wayland/dpms_interface.cpp b/src/wayland/dpms_interface.cpp index 866c3ec9ec..411b78d81c 100644 --- a/src/wayland/dpms_interface.cpp +++ b/src/wayland/dpms_interface.cpp @@ -133,11 +133,19 @@ void DpmsInterface::org_kde_kwin_dpms_set(Resource *resource, uint32_t mode) void DpmsInterface::sendSupported() { + if (!m_output || m_output->isRemoved()) { + return; + } + send_supported(m_output->handle()->capabilities() & Output::Capability::Dpms ? 1 : 0); } void DpmsInterface::sendMode() { + if (!m_output || m_output->isRemoved()) { + return; + } + const auto mode = m_output->handle()->dpmsMode(); org_kde_kwin_dpms_mode wlMode; switch (mode) {