x11: ignore mouse scroll button release events
This commit is contained in:
parent
1e7ab0cd25
commit
03dad26c43
2 changed files with 13 additions and 9 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -269,3 +269,4 @@ changelog entry.
|
|||
- On Windows 11, prevent incorrect shifting when dragging window onto a monitor with different DPI.
|
||||
- On Web, device events are emitted regardless of cursor type.
|
||||
- On Wayland, `axis_value120` scroll events now generate `MouseScrollDelta::LineDelta`
|
||||
- On X11, mouse scroll button events no longer cause duplicated `WindowEvent::MouseWheel` events.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue