fix: trackpad, reverse horizontal scroll (#8827)

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2024-07-25 14:44:58 +08:00 committed by GitHub
parent b967d496cc
commit baf70da2fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -973,12 +973,11 @@ pub fn handle_mouse_(evt: &MouseEvent, conn: i32) {
},
MOUSE_TYPE_WHEEL | MOUSE_TYPE_TRACKPAD => {
#[allow(unused_mut)]
let mut x = evt.x;
let mut x = -evt.x;
#[allow(unused_mut)]
let mut y = evt.y;
#[cfg(not(windows))]
{
x = -x;
y = -y;
}

View File

@ -1018,7 +1018,7 @@ impl<T: InvokeUiSession> Session<T> {
}
}
let (x, y) = if mask == MOUSE_TYPE_WHEEL {
let (x, y) = if mask == MOUSE_TYPE_WHEEL || mask == MOUSE_TYPE_TRACKPAD {
self.get_scroll_xy((x, y))
} else {
(x, y)