aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaggerbot <daggerbot@gmail.com>2015-04-11 18:17:49 -0700
committerDaggerbot <daggerbot@gmail.com>2015-04-11 18:17:49 -0700
commitc9194e922e3a60e8511cba8f50472f1f3457ddad (patch)
treeee04e2defe4bf2474011226203c9a98c1bf998ba /src
parent2d20050b892f37bb7f7c02aa4408b8627649f8e1 (diff)
downloadglutin-c9194e922e3a60e8511cba8f50472f1f3457ddad.tar.gz
glutin-c9194e922e3a60e8511cba8f50472f1f3457ddad.zip
Fixes for x11-rs/osmesa-sys conversion.
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs6
-rw-r--r--src/x11/ffi.rs1
-rw-r--r--src/x11/window/mod.rs6
3 files changed, 7 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9173735..9ed059e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -46,10 +46,10 @@ extern crate cocoa;
extern crate core_foundation;
#[cfg(target_os = "macos")]
extern crate glutin_core_graphics as core_graphics;
-#[cfg(target_os = "linux")]
-extern crate osmesa_sys;
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "freebsd"))]
extern crate x11;
+#[cfg(all(any(target_os = "linux", target_os = "freebsd"), feature="headless"))]
+extern crate osmesa_sys;
pub use events::*;
#[cfg(feature = "headless")]
diff --git a/src/x11/ffi.rs b/src/x11/ffi.rs
index 8acf681..2fcda3b 100644
--- a/src/x11/ffi.rs
+++ b/src/x11/ffi.rs
@@ -1,3 +1,4 @@
+#[cfg(feature="headless")]
pub use osmesa_sys::*;
pub use x11::keysym::*;
pub use x11::xcursor::*;
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs
index 5527b9e..270746f 100644
--- a/src/x11/window/mod.rs
+++ b/src/x11/window/mod.rs
@@ -90,7 +90,7 @@ pub struct WindowProxy {
impl WindowProxy {
pub fn wakeup_event_loop(&self) {
let mut xev = ffi::XClientMessageEvent {
- _type: ffi::ClientMessage,
+ type_: ffi::ClientMessage,
window: self.x.window,
format: 32,
message_type: 0,
@@ -171,7 +171,7 @@ impl<'a> Iterator for PollEventsIterator<'a> {
use events::ElementState::{Pressed, Released};
let event: &mut ffi::XKeyEvent = unsafe { mem::transmute(&xev) };
- if event._type == ffi::KeyPress {
+ if event.type_ == ffi::KeyPress {
let raw_ev: *mut ffi::XKeyEvent = event;
unsafe { ffi::XFilterEvent(mem::transmute(raw_ev), self.window.x.window) };
}
@@ -335,7 +335,7 @@ impl Window {
return Err(OsError(format!("glx::ChooseFBConfig failed")));
}
let preferred_fb = *fb; // TODO: choose more wisely
- ffi::XFree(fb as *mut ());
+ ffi::XFree(fb as *mut _);
preferred_fb
};