IB7BAT6ELPDA7V3G53E4D4TNVUHXBXEPI7NYYDN6KR6T2LVH5QYQC
MT3IK66TJ6KVVJLT3JBN5CIJTZVD5WSYRK5WDVRGQ4BPFXACXJKQC
IG6HG46TPITA2WAGCY3OTNRZS3364F7X3NS4MX3YXO2FPKOVGG7AC
KWR2TS2D7YN4LCGMQZ35V4WBLQDHAVSZJV3SZAIR5HQRSJAWLWCQC
2JZYL7R4OQIZMHTBGZA6HNAC7KLN7DSGZJRE7YILLMTR3WR2XLHAC
7RMAZDLQ6FEEQGUUAIVEM4X2VME7IUUZMEJMMV3H46U3UKO4BODQC
7MWGEO4D53CRQYELJQJ3PMI3BZJNAJJRX7AESNZ4NMF23XGBFEGAC
// TODO: Add XEventsQueued constants to xlib
#[allow(non_upper_case_globals)]
const QueuedAfterReading: c_int = 1;
loop {
// TODO: Add XEventsQueued constants to xlib
#[allow(non_upper_case_globals)]
const QueuedAfterReading: c_int = 1;
let num_events = unsafe {
(self.xlib.XEventsQueued)(self.display, QueuedAfterReading)
};
let num_events = unsafe {
(self.xlib.XEventsQueued)(self.display, QueuedAfterReading)
};
if num_events <= 0 {
self.io.clear_read_ready(cx, mio::Ready::readable())?;
return Poll::Pending;
}
if num_events <= 0 {
self.io.clear_read_ready(cx, mio::Ready::readable())?;
return Poll::Pending;
}
let event = unsafe {
let mut event = MaybeUninit::uninit();
(self.xlib.XNextEvent)(self.display, event.as_mut_ptr());
event.assume_init()
};
let event = unsafe {
let mut event = MaybeUninit::uninit();
(self.xlib.XNextEvent)(self.display, event.as_mut_ptr());
event.assume_init()
};
let host_event = match event.get_type() {
// Standard events
xlib::ButtonPress => Some(HostEvent::Button(Self::map_button_event(event.into(), true))),
xlib::ButtonRelease => Some(HostEvent::Button(Self::map_button_event(event.into(), false))),
xlib::KeyPress => Some(HostEvent::Key(self.map_key_event(event.into(), true))),
xlib::KeyRelease => Some(HostEvent::Key(self.map_key_event(event.into(), false))),
xlib::MappingNotify => None,
xlib::GenericEvent => self.map_generic_event(event.into()),
let host_event = match event.get_type() {
// Standard events
xlib::ButtonPress => Some(HostEvent::Button(Self::map_button_event(event.into(), true))),
xlib::ButtonRelease => Some(HostEvent::Button(Self::map_button_event(event.into(), false))),
xlib::KeyPress => Some(HostEvent::Key(self.map_key_event(event.into(), true))),
xlib::KeyRelease => Some(HostEvent::Key(self.map_key_event(event.into(), false))),
xlib::MappingNotify => None,
xlib::GenericEvent => self.map_generic_event(event.into()),
// XFixes selection events
event_type if event_type - self.xfixes_event_base == xfixes::XFixesSelectionNotify =>
self.map_selection_event(event.into()),