mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 13:52:55 +03:00
Implment focus_change for X11
This commit is contained in:
parent
69ed1e7aed
commit
6558230c9f
@ -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,
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user