From 64279b21fccb4a66dde1f7275e3d7463347f3956 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 9 Nov 2024 00:22:15 +0100 Subject: [PATCH] Fix idle-notify on double-tap wakeup 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. --- src/catacomb.rs | 6 ++++-- src/input.rs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/catacomb.rs b/src/catacomb.rs index 673a345..2b46e94 100644 --- a/src/catacomb.rs +++ b/src/catacomb.rs @@ -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); } diff --git a/src/input.rs b/src/input.rs index 220847b..403808a 100644 --- a/src/input.rs +++ b/src/input.rs @@ -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), _ => (), }