mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 19:06:34 +00:00
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.
This commit is contained in:
parent
0cd508a2ec
commit
5a67c80caa
1 changed files with 10 additions and 10 deletions
|
|
@ -9,24 +9,24 @@ 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() {
|
||||
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() {
|
||||
cec_wake();
|
||||
if !wlr_output_on() {
|
||||
xset_dpms_on();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn cec_standby() -> bool {
|
||||
|
|
|
|||
Loading…
Reference in a new issue