Desktop: Resize issue mitigation, scroll speed adjustment and duplicate pointer move event filtering (#3424)

* mitigate resizing issue on mac and windows

* adjust scroll speed for mac and win

* fixup

* filter out duplicate mouse move events
This commit is contained in:
Timon
2025-11-27 16:18:52 +00:00
committed by GitHub
parent 8cebde76e2
commit f4608a6e40
4 changed files with 25 additions and 5 deletions
+8 -3
View File
@@ -17,8 +17,13 @@ impl InputState {
self.modifiers = *modifiers;
}
pub(crate) fn cursor_move(&mut self, position: &PhysicalPosition<f64>) {
self.mouse_position = position.into();
pub(crate) fn cursor_move(&mut self, position: &PhysicalPosition<f64>) -> bool {
let new = position.into();
if self.mouse_position == new {
return false;
}
self.mouse_position = new;
true
}
pub(crate) fn mouse_input(&mut self, button: &MouseButton, state: &ElementState) -> ClickCount {
@@ -59,7 +64,7 @@ impl From<&mut InputState> for MouseEvent {
}
}
#[derive(Default, Clone, Copy)]
#[derive(Default, Clone, Copy, Eq, PartialEq)]
pub(crate) struct MousePosition {
x: usize,
y: usize,