From 93e139e74604464a7249e782535289aabdbff8f4 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Thu, 12 Oct 2023 19:15:47 -0500 Subject: [PATCH] Send pointer frame on pointer events --- src/input.rs | 15 ++++++++++----- src/render/pointer.rs | 3 +-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/input.rs b/src/input.rs index 49f9dd3..b2c7f9a 100644 --- a/src/input.rs +++ b/src/input.rs @@ -500,6 +500,7 @@ impl State { time: event.time_msec(), }, ); + pointer.frame(self); } fn pointer_axis(&mut self, event: I::PointerAxisEvent) { @@ -545,10 +546,10 @@ impl State { // self.seat.get_pointer().unwrap().current_focus() // ); - self.seat - .get_pointer() - .expect("Seat has no pointer") - .axis(self, frame); + let pointer = self.seat.get_pointer().expect("Seat has no pointer"); + + pointer.axis(self, frame); + pointer.frame(self); } /// Clamp pointer coordinates inside outputs @@ -626,6 +627,8 @@ impl State { time: event.time_msec(), }, ); + + pointer.frame(self); } fn pointer_motion(&mut self, event: I::PointerMotionEvent) { @@ -673,7 +676,9 @@ impl State { delta_unaccel: event.delta_unaccel(), utime: event.time(), }, - ) + ); + + ptr.frame(self); } } } diff --git a/src/render/pointer.rs b/src/render/pointer.rs index 3cf6a94..b8b6c07 100644 --- a/src/render/pointer.rs +++ b/src/render/pointer.rs @@ -65,7 +65,7 @@ where ) -> Vec { match &self.status { CursorImageStatus::Hidden => vec![], - CursorImageStatus::Named(CursorIcon::Default) => { + CursorImageStatus::Named(_) => { if let Some(texture) = self.texture.as_ref() { vec![PointerRenderElement::::from( TextureRenderElement::from_texture_buffer( @@ -82,7 +82,6 @@ where vec![] } } - CursorImageStatus::Named(_) => vec![], CursorImageStatus::Surface(surface) => { let elements: Vec> = surface::render_elements_from_surface_tree(