aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11/window/monitor.rs
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2014-10-24 12:31:33 +0200
committertomaka <pierre.krieger1708@gmail.com>2014-10-24 12:31:33 +0200
commit2c9eaf86512a77da5f20acc87d9c5cd949078a85 (patch)
tree9afb2be42ba29021699d5b2611be0cd4e11e53cb /src/x11/window/monitor.rs
parentfe8646c55681d6ecbd290010ab702f8f0feecc00 (diff)
parent97c471dc05b2b9c928758ae23f2f8cafd9d36dda (diff)
downloadglutin-2c9eaf86512a77da5f20acc87d9c5cd949078a85.tar.gz
glutin-2c9eaf86512a77da5f20acc87d9c5cd949078a85.zip
Merge pull request #65 from glennw/x-threads
Add an interface for providing system wide initialization options to the windowing system.
Diffstat (limited to 'src/x11/window/monitor.rs')
-rw-r--r--src/x11/window/monitor.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/x11/window/monitor.rs b/src/x11/window/monitor.rs
index 465d132..013b48b 100644
--- a/src/x11/window/monitor.rs
+++ b/src/x11/window/monitor.rs
@@ -1,9 +1,11 @@
use std::{ptr};
use super::super::ffi;
+use super::ensure_thread_init;
pub struct MonitorID(pub uint);
pub fn get_available_monitors() -> Vec<MonitorID> {
+ ensure_thread_init();
let nb_monitors = unsafe {
let display = ffi::XOpenDisplay(ptr::null());
if display.is_null() {
@@ -20,6 +22,7 @@ pub fn get_available_monitors() -> Vec<MonitorID> {
}
pub fn get_primary_monitor() -> MonitorID {
+ ensure_thread_init();
let primary_monitor = unsafe {
let display = ffi::XOpenDisplay(ptr::null());
if display.is_null() {