3
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2025-10-29 11:22:47 +00:00

protocols: fix output power protocol not sending mode confirmation (#12072)

Use setDPMS() instead of directly manipulating m_dpmsStatus to ensure the dpmsChanged event fires and protocol
clients receive mode change confirmation via sendMode().
This commit is contained in:
Bang Lee 2025-10-18 11:44:55 -07:00 committed by GitHub
parent 6607c6440d
commit 39d62e1487
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,12 +13,7 @@ COutputPower::COutputPower(SP<CZwlrOutputPowerV1> resource_, PHLMONITOR pMonitor
if (!m_monitor)
return;
m_monitor->m_dpmsStatus = mode == ZWLR_OUTPUT_POWER_V1_MODE_ON;
m_monitor->m_output->state->setEnabled(mode == ZWLR_OUTPUT_POWER_V1_MODE_ON);
if (!m_monitor->m_state.commit())
LOGM(ERR, "Couldn't set dpms to {} for {}", m_monitor->m_dpmsStatus, m_monitor->m_name);
m_monitor->setDPMS(mode == ZWLR_OUTPUT_POWER_V1_MODE_ON);
});
m_resource->sendMode(m_monitor->m_dpmsStatus ? ZWLR_OUTPUT_POWER_V1_MODE_ON : ZWLR_OUTPUT_POWER_V1_MODE_OFF);