x11: ignore mouse scroll button release events

This commit is contained in:
Pavel Strakhov 2025-10-24 12:07:10 +01:00 committed by GitHub
parent 1e7ab0cd25
commit 03dad26c43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 9 deletions

View file

@ -1020,16 +1020,19 @@ impl EventProcessor {
// those. In practice, even clicky scroll wheels appear to be reported by
// evdev (and XInput2 in turn) as axis motion, so we don't otherwise
// special-case these button presses.
4..=7 => WindowEvent::MouseWheel {
device_id,
delta: match event.detail {
4 => MouseScrollDelta::LineDelta(0.0, 1.0),
5 => MouseScrollDelta::LineDelta(0.0, -1.0),
6 => MouseScrollDelta::LineDelta(1.0, 0.0),
7 => MouseScrollDelta::LineDelta(-1.0, 0.0),
_ => unreachable!(),
4..=7 => match state {
ElementState::Pressed => WindowEvent::MouseWheel {
device_id,
delta: match event.detail {
4 => MouseScrollDelta::LineDelta(0.0, 1.0),
5 => MouseScrollDelta::LineDelta(0.0, -1.0),
6 => MouseScrollDelta::LineDelta(1.0, 0.0),
7 => MouseScrollDelta::LineDelta(-1.0, 0.0),
_ => unreachable!(),
},
phase: TouchPhase::Moved,
},
phase: TouchPhase::Moved,
ElementState::Released => return,
},
8 => WindowEvent::PointerButton {
device_id,