Fix XI2 Scrolling Issue (#12603)

ref #11679
https://github.com/zed-industries/zed/pull/11235#issuecomment-2144727144

Filters leave events to ensure they are in the normal notify leave
events (not grab or ungrab)
([spec](https://www.x.org/releases/X11R7.7/doc/inputproto/XI2proto.txt)).
Confirmed to fix the issue @mrnugget was having.

Release Notes:

- linux: Fixed a regression that caused some X11 input devices being
unable to scroll.
This commit is contained in:
Owen Law 2024-06-03 11:10:14 -04:00 committed by GitHub
parent d0fa012bf8
commit 2b21c89e3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 3 deletions

View File

@ -766,7 +766,7 @@ impl X11Client {
valuator_idx += 1;
}
}
Event::XinputLeave(event) => {
Event::XinputLeave(event) if event.mode == xinput::NotifyMode::NORMAL => {
self.0.borrow_mut().scroll_x = None; // Set last scroll to `None` so that a large delta isn't created if scrolling is done outside the window (the valuator is global)
self.0.borrow_mut().scroll_y = None;

View File

@ -261,8 +261,6 @@ impl X11WindowState {
.event_mask(
xproto::EventMask::EXPOSURE
| xproto::EventMask::STRUCTURE_NOTIFY
| xproto::EventMask::ENTER_WINDOW
| xproto::EventMask::LEAVE_WINDOW
| xproto::EventMask::FOCUS_CHANGE
| xproto::EventMask::KEY_PRESS
| xproto::EventMask::KEY_RELEASE,