From ac6880b6ee0edf39b16283a2bc0afdeff2c0945d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 22 Apr 2022 18:57:49 -0600 Subject: [PATCH] Only set the cursor style once per mouse move event This will hopefully prevent some of the intermittent flickering we seem to be seeing. --- crates/gpui/src/presenter.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/presenter.rs b/crates/gpui/src/presenter.rs index 85f21ba5cb..a7d715fadf 100644 --- a/crates/gpui/src/presenter.rs +++ b/crates/gpui/src/presenter.rs @@ -181,13 +181,14 @@ impl Presenter { self.last_mouse_moved_event = Some(event.clone()); if !left_mouse_down { - cx.platform().set_cursor_style(CursorStyle::Arrow); + let mut style_to_assign = CursorStyle::Arrow; for (bounds, style) in self.cursor_styles.iter().rev() { if bounds.contains_point(position) { - cx.platform().set_cursor_style(*style); + style_to_assign = *style; break; } } + cx.platform().set_cursor_style(style_to_assign); } } Event::LeftMouseDragged { position } => {