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
This commit is contained in:
Aleix Pol 2023-03-27 02:11:37 +02:00 committed by Vlad Zahorodnii
parent 71956e1bb5
commit fb3018b711

View file

@ -133,11 +133,19 @@ void DpmsInterface::org_kde_kwin_dpms_set(Resource *resource, uint32_t mode)
void DpmsInterface::sendSupported() void DpmsInterface::sendSupported()
{ {
if (!m_output || m_output->isRemoved()) {
return;
}
send_supported(m_output->handle()->capabilities() & Output::Capability::Dpms ? 1 : 0); send_supported(m_output->handle()->capabilities() & Output::Capability::Dpms ? 1 : 0);
} }
void DpmsInterface::sendMode() void DpmsInterface::sendMode()
{ {
if (!m_output || m_output->isRemoved()) {
return;
}
const auto mode = m_output->handle()->dpmsMode(); const auto mode = m_output->handle()->dpmsMode();
org_kde_kwin_dpms_mode wlMode; org_kde_kwin_dpms_mode wlMode;
switch (mode) { switch (mode) {