1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-19 02:37:51 +03:00

x11: simplify focus event matching

refs: #2959
This commit is contained in:
Wez Furlong 2023-02-02 08:25:30 -07:00
parent 3bee573bf8
commit 8cff8fc918
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -585,18 +585,16 @@ impl XWindowInner {
self.verify_focus = true;
}
}
Event::X(xcb::x::Event::FocusIn(e)) => match e.detail() {
xcb::x::NotifyDetail::Pointer => (),
_ => {
self.focus_changed(true);
}
},
Event::X(xcb::x::Event::FocusOut(e)) => match e.detail() {
xcb::x::NotifyDetail::Pointer => (),
_ => {
self.focus_changed(false);
}
},
Event::X(xcb::x::Event::FocusIn(e))
if !matches!(e.detail(), xcb::x::NotifyDetail::Pointer) =>
{
self.focus_changed(true);
}
Event::X(xcb::x::Event::FocusOut(e))
if !matches!(e.detail(), xcb::x::NotifyDetail::Pointer) =>
{
self.focus_changed(false);
}
Event::X(xcb::x::Event::LeaveNotify(_)) => {
self.events.dispatch(WindowEvent::MouseLeave);
}