Skip to content

Commit

Permalink
Fix DPMS handling regressions
Browse files Browse the repository at this point in the history
This patch fixes two separate regressions. The first one was introduced
in 3d04f9e, where the `sleeping` field was renamed to `display_on`.
Since the field's value was inverted, it was necessary to switch all
conditionals accessing this field, which was forgotten for the one that
toggles the accelerometer timer on DPMS on/off.

Then 64279b2 made use of the same conditional to simulate activity
whenever the display is turned on, however it accidentally checked for
the display to be off. As a result turning the display off would
automatically cause activity, waking the display back up.
  • Loading branch information
chrisduerr committed Nov 10, 2024
1 parent 64279b2 commit 7a10535
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/catacomb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,15 @@ impl Catacomb {

// Pause accelerometer checks while display is off.
if on {
trace_error!(self.event_loop.disable(&self.accelerometer_token));
} else if !self.windows.orientation_locked() {
trace_error!(self.event_loop.enable(&self.accelerometer_token));
}

// Count wakeup as activity, to ensure that clients like wayidle receive a
// resume and new idle events after waking the monitor back up.
if !on {
// Count wakeup as activity, to ensure that clients like wayidle receive a
// resume and new idle events after waking the monitor back up.
self.idle_notifier_state.notify_activity(&self.seat);

if !self.windows.orientation_locked() {
trace_error!(self.event_loop.enable(&self.accelerometer_token));
}
} else {
trace_error!(self.event_loop.disable(&self.accelerometer_token));
}

self.backend.set_display_status(on);
Expand Down
1 change: 0 additions & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ impl Catacomb {
self.touch_state.last_tap =
Some((Instant::now(), event.position));
},
// TODO: Update idle timeout.
Some(TouchAction::DoubleTap) => self.set_display_status(true),
_ => (),
}
Expand Down

0 comments on commit 7a10535

Please sign in to comment.