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:
parent
6607c6440d
commit
39d62e1487
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user