1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 03:09:06 +03:00

Implment focus_change for X11

This commit is contained in:
Jeremy Fitzhardinge 2019-12-28 22:52:10 -08:00 committed by Wez Furlong
parent 69ed1e7aed
commit 6558230c9f
2 changed files with 16 additions and 0 deletions

View File

@ -124,6 +124,14 @@ fn window_id_from_event(event: &xcb::GenericEvent) -> Option<xcb::xproto::Window
let msg: &xcb::SelectionRequestEvent = unsafe { xcb::cast_event(event) };
Some(msg.owner())
}
xcb::FOCUS_IN => {
let msg: &xcb::FocusInEvent = unsafe { xcb::cast_event(event) };
Some(msg.event())
}
xcb::FOCUS_OUT => {
let msg: &xcb::FocusOutEvent = unsafe { xcb::cast_event(event) };
Some(msg.event())
}
_ => None,
}
}

View File

@ -374,6 +374,14 @@ impl XWindowInner {
self.conn.atom_xsel_data
);
}
xcb::FOCUS_IN => {
log::trace!("Calling focus_change(true)");
self.callbacks.focus_change(true);
}
xcb::FOCUS_OUT => {
log::trace!("Calling focus_change(false)");
self.callbacks.focus_change(false);
}
_ => {
eprintln!("unhandled: {:x}", r);
}