mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
linux/x11: Only create ModifiersChanged event if they changed (#12879)
I noticed that when I use my mouse wheel, we get a ton of the `XkbStateNotify` events, but the modifiers don't change, so we add a ton of useless input events for the window. Release Notes: - N/A
This commit is contained in:
parent
ef84ce76e3
commit
3722275cfa
@ -524,7 +524,11 @@ impl X11Client {
|
||||
0,
|
||||
event.locked_group.into(),
|
||||
);
|
||||
|
||||
let modifiers = Modifiers::from_xkb(&state.xkb);
|
||||
if state.modifiers == modifiers {
|
||||
drop(state);
|
||||
} else {
|
||||
let focused_window_id = state.focused_window?;
|
||||
state.modifiers = modifiers;
|
||||
drop(state);
|
||||
@ -534,6 +538,7 @@ impl X11Client {
|
||||
ModifiersChangedEvent { modifiers },
|
||||
));
|
||||
}
|
||||
}
|
||||
Event::KeyPress(event) => {
|
||||
let window = self.get_window(event.event)?;
|
||||
let mut state = self.0.borrow_mut();
|
||||
|
Loading…
Reference in New Issue
Block a user