diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2014-10-24 14:49:07 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-10-24 19:58:19 +1000 |
commit | 97c471dc05b2b9c928758ae23f2f8cafd9d36dda (patch) | |
tree | eacc999375ca034e173a32a80c5415a0b998a97a /src/x11/window/monitor.rs | |
parent | d8ca679a6ec92ea8428ad5e3733a65b2e045d02c (diff) | |
download | glutin-97c471dc05b2b9c928758ae23f2f8cafd9d36dda.tar.gz glutin-97c471dc05b2b9c928758ae23f2f8cafd9d36dda.zip |
Add an interface for providing system wide initialization options to the windowing system.
This allows setting up Linux based systems which use multithreaded OpenGL contexts.
Diffstat (limited to 'src/x11/window/monitor.rs')
-rw-r--r-- | src/x11/window/monitor.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/x11/window/monitor.rs b/src/x11/window/monitor.rs index b72ed15..a9e77d7 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() { |