From 0670b1ec2e002f8881154d10720d7dded0f23b10 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Wed, 25 Mar 2015 12:48:32 +1000 Subject: Add Expose event handler which is needed on some window managers. --- src/events.rs | 3 +++ src/x11/window/mod.rs | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/events.rs b/src/events.rs index ac30cfd..957e0c3 100644 --- a/src/events.rs +++ b/src/events.rs @@ -34,6 +34,9 @@ pub enum Event { /// The event loop was woken up by another thread. Awakened, + + /// The window needs to be redrawn. + Refresh, } pub type ScanCode = u8; diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index 9f600a8..5b1b42d 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -161,6 +161,11 @@ impl<'a> Iterator for PollEventsIterator<'a> { } }, + ffi::Expose => { + use events::Event::Refresh; + return Some(Refresh); + }, + ffi::MotionNotify => { use events::Event::MouseMoved; let event: &ffi::XMotionEvent = unsafe { mem::transmute(&xev) }; -- cgit v1.2.3