aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2015-03-25 12:48:32 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2015-04-24 07:32:36 +1000
commit0670b1ec2e002f8881154d10720d7dded0f23b10 (patch)
treeb91f3f57b615ef1241b158482f6a63f0db992990
parentd8cd748e35c1ab254d398a7ffa6f923799c9c28d (diff)
downloadglutin-0670b1ec2e002f8881154d10720d7dded0f23b10.tar.gz
glutin-0670b1ec2e002f8881154d10720d7dded0f23b10.zip
Add Expose event handler which is needed on some window managers.
-rw-r--r--src/events.rs3
-rw-r--r--src/x11/window/mod.rs5
2 files changed, 8 insertions, 0 deletions
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) };