Add Expose event handler which is needed on some window managers.

This commit is contained in:
Glenn Watson 2015-03-25 12:48:32 +10:00
parent d8cd748e35
commit 0670b1ec2e
2 changed files with 8 additions and 0 deletions

View file

@ -34,6 +34,9 @@ pub enum Event {
/// The event loop was woken up by another thread. /// The event loop was woken up by another thread.
Awakened, Awakened,
/// The window needs to be redrawn.
Refresh,
} }
pub type ScanCode = u8; pub type ScanCode = u8;

View file

@ -161,6 +161,11 @@ impl<'a> Iterator for PollEventsIterator<'a> {
} }
}, },
ffi::Expose => {
use events::Event::Refresh;
return Some(Refresh);
},
ffi::MotionNotify => { ffi::MotionNotify => {
use events::Event::MouseMoved; use events::Event::MouseMoved;
let event: &ffi::XMotionEvent = unsafe { mem::transmute(&xev) }; let event: &ffi::XMotionEvent = unsafe { mem::transmute(&xev) };