diff --git a/src/cursor.rs b/src/cursor.rs index a17c6ae..770c940 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -145,7 +145,7 @@ impl CursorState { return None; } - let mut millis = self.start_time.duration_since(Instant::now()).as_millis() as u32; + let mut millis = self.start_time.elapsed().as_millis() as u32; let animation_length_ms = nearest_size_images(self.size, &cursor.images) .fold(0, |acc, image| acc + image.delay); millis %= animation_length_ms; diff --git a/src/layout/transaction.rs b/src/layout/transaction.rs index 771f8e9..75631ce 100644 --- a/src/layout/transaction.rs +++ b/src/layout/transaction.rs @@ -144,7 +144,7 @@ impl LayoutTransaction { /// Returns whether all pending windows have committed their serials or the timeout has been /// reached. pub fn ready(&self) -> bool { - Instant::now().duration_since(self.start_time) >= TIMEOUT + self.start_time.elapsed() >= TIMEOUT || (!self.wait && self .pending_windows