diff --git a/src/tasks/hardware_cursor.rs b/src/tasks/hardware_cursor.rs index 65e43092..0f6dba81 100644 --- a/src/tasks/hardware_cursor.rs +++ b/src/tasks/hardware_cursor.rs @@ -24,6 +24,10 @@ pub async fn handle_hardware_cursor_tick(state: Rc) { log::error!("Could not wait for cursor tick: {}", ErrorFmt(e)); break; } + } else { + if state.hardware_tick_cursor.is_not_empty() { + break; + } } state.refresh_hardware_cursors(); } diff --git a/src/utils/queue.rs b/src/utils/queue.rs index 21b0a6ba..8e55ba6b 100644 --- a/src/utils/queue.rs +++ b/src/utils/queue.rs @@ -50,6 +50,14 @@ impl AsyncQueue { AsyncQueueNonEmpty { queue: self } } + pub fn is_empty(&self) -> bool { + unsafe { self.data.get().deref().is_empty() } + } + + pub fn is_not_empty(&self) -> bool { + !self.is_empty() + } + pub fn clear(&self) { unsafe { mem::take(self.data.get().deref_mut());