move mouse move-scroll exclusivity to hid module

This commit is contained in:
galister
2024-09-11 06:03:22 +09:00
parent b0a33a1181
commit 13d9284bb8
2 changed files with 6 additions and 8 deletions

View File

@@ -242,7 +242,7 @@ impl HidProvider for UInputProvider {
self.desktop_origin = origin;
}
fn mouse_move(&mut self, pos: Vec2) {
if self.current_action.pos.is_none() {
if self.current_action.pos.is_none() && self.current_action.scroll.is_none() {
self.current_action.pos = Some(pos);
}
self.current_action.last_requested_pos = Some(pos);
@@ -256,6 +256,9 @@ impl HidProvider for UInputProvider {
fn wheel(&mut self, delta: i32) {
if self.current_action.scroll.is_none() {
self.current_action.scroll = Some(delta);
// Pass mouse motion events only if not scrolling
// (allows scrolling on all Chromium-based applications)
self.current_action.pos = None;
}
}
fn commit(&mut self) {