aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-02-21 18:11:02 +0100
committertomaka <pierre.krieger1708@gmail.com>2015-02-21 18:11:02 +0100
commit06eab6f6c0ad2d8085e2074c47967f770e49792a (patch)
tree862f0b3320c22d8cd5b7283203b71f10b66dab7d /src/x11
parent7ff76cddd981d64fbf0f821ba8a5f456fd0fcb29 (diff)
parent1055eed078f674ad4cc657e99a247310183d635e (diff)
downloadglutin-06eab6f6c0ad2d8085e2074c47967f770e49792a.tar.gz
glutin-06eab6f6c0ad2d8085e2074c47967f770e49792a.zip
Merge pull request #286 from mitchmindtree/master
Updated to latest nightly - RingBuf -> VecDeque, removed unnecessary as_slice_with_nul
Diffstat (limited to 'src/x11')
-rw-r--r--src/x11/headless.rs2
-rw-r--r--src/x11/window/mod.rs8
-rw-r--r--src/x11/window/monitor.rs6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/x11/headless.rs b/src/x11/headless.rs
index 20d86e3..ca47414 100644
--- a/src/x11/headless.rs
+++ b/src/x11/headless.rs
@@ -8,7 +8,7 @@ use super::ffi;
fn with_c_str<F, T>(s: &str, f: F) -> T where F: FnOnce(*const libc::c_char) -> T {
use std::ffi::CString;
let c_str = CString::from_slice(s.as_bytes());
- f(c_str.as_slice_with_nul().as_ptr())
+ f(c_str.as_ptr())
}
pub struct HeadlessContext {
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs
index faeea3e..8664b4a 100644
--- a/src/x11/window/mod.rs
+++ b/src/x11/window/mod.rs
@@ -5,7 +5,7 @@ use libc;
use std::{mem, ptr};
use std::cell::Cell;
use std::sync::atomic::AtomicBool;
-use std::collections::RingBuf;
+use std::collections::VecDeque;
use super::ffi;
use std::sync::{Arc, Mutex, Once, ONCE_INIT, Weak};
use std::sync::{StaticMutex, MUTEX_INIT};
@@ -39,7 +39,7 @@ fn ensure_thread_init() {
fn with_c_str<F, T>(s: &str, f: F) -> T where F: FnOnce(*const libc::c_char) -> T {
use std::ffi::CString;
let c_str = CString::from_slice(s.as_bytes());
- f(c_str.as_slice_with_nul().as_ptr())
+ f(c_str.as_ptr())
}
struct XWindow {
@@ -281,7 +281,7 @@ pub struct Window {
wm_delete_window: ffi::Atom,
current_size: Cell<(libc::c_int, libc::c_int)>,
/// Events that have been retreived with XLib but not dispatched with iterators yet
- pending_events: Mutex<RingBuf<Event>>,
+ pending_events: Mutex<VecDeque<Event>>,
}
impl Window {
@@ -600,7 +600,7 @@ impl Window {
is_closed: AtomicBool::new(false),
wm_delete_window: wm_delete_window,
current_size: Cell::new((0, 0)),
- pending_events: Mutex::new(RingBuf::new()),
+ pending_events: Mutex::new(VecDeque::new()),
};
// returning
diff --git a/src/x11/window/monitor.rs b/src/x11/window/monitor.rs
index 3c188b6..77ac4ec 100644
--- a/src/x11/window/monitor.rs
+++ b/src/x11/window/monitor.rs
@@ -1,11 +1,11 @@
use std::ptr;
-use std::collections::RingBuf;
+use std::collections::VecDeque;
use super::super::ffi;
use super::ensure_thread_init;
pub struct MonitorID(pub u32);
-pub fn get_available_monitors() -> RingBuf<MonitorID> {
+pub fn get_available_monitors() -> VecDeque<MonitorID> {
ensure_thread_init();
let nb_monitors = unsafe {
let display = ffi::XOpenDisplay(ptr::null());
@@ -17,7 +17,7 @@ pub fn get_available_monitors() -> RingBuf<MonitorID> {
nb_monitors
};
- let mut monitors = RingBuf::new();
+ let mut monitors = VecDeque::new();
monitors.extend(range(0, nb_monitors).map(|i| MonitorID(i as u32)));
monitors
}