Skip to content

Commit

Permalink
Fix idle-notify on double-tap wakeup
Browse files Browse the repository at this point in the history
3d04f9e exposed a bug where the system could enter a deeper idle state
even after it was woken up using the new double-tap gesture, since the
gesture itself wasn't counted as activity.

After this patch any wakeup of the display going through Catacomb will
be counted as activity, instead of incorrectly only counting it while
the orientation wasn't locked.
  • Loading branch information
chrisduerr committed Nov 8, 2024
1 parent c7e0749 commit 64279b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/catacomb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,11 @@ impl Catacomb {
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.
// 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 {
self.idle_notifier_state.notify_activity(&self.seat);
}

Expand Down
1 change: 1 addition & 0 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ 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 64279b2

Please sign in to comment.