From 5a67c80caad3392d1776af1a765e32364736a844 Mon Sep 17 00:00:00 2001 From: Mitchell R Date: Mon, 11 May 2026 11:18:31 +0200 Subject: [PATCH] fix: fire CEC AND DPMS unconditionally for power commands Pi5 cec-ctl returns ok even when monitor ignores CEC. Doing both covers TVs (CEC) and monitors (DPMS) without detection logic. Both idempotent. --- kiosk/src/cec.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kiosk/src/cec.rs b/kiosk/src/cec.rs index 796d84c..e3d307b 100644 --- a/kiosk/src/cec.rs +++ b/kiosk/src/cec.rs @@ -9,23 +9,23 @@ use tracing::{info, warn}; const CEC_DEVICE: &str = "/dev/cec0"; -/// Put the display to sleep — try CEC first, fall back to compositor DPMS. +/// Put the display to sleep — fire both CEC and DPMS. +/// CEC handles TVs that listen. DPMS handles monitors that don't. +/// Both are idempotent; doing both is cheap and covers both cases. pub fn standby() { info!("power: standby"); - if !cec_standby() { - if !wlr_output_off() { - xset_dpms_off(); - } + cec_standby(); + if !wlr_output_off() { + xset_dpms_off(); } } -/// Wake the display — try CEC first, fall back to compositor DPMS. +/// Wake the display — fire both CEC and DPMS. pub fn wake() { info!("power: wake"); - if !cec_wake() { - if !wlr_output_on() { - xset_dpms_on(); - } + cec_wake(); + if !wlr_output_on() { + xset_dpms_on(); } }