From 6d3d84ef753b4e998221290acc1b72a75d3ff8a5 Mon Sep 17 00:00:00 2001 From: DavidPartouche Date: Sat, 20 Sep 2014 11:18:03 +0200 Subject: [PATCH] Use the correct monitor when fullscreen for X11 --- src/x11/mod.rs | 5 +++-- src/x11/monitor.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/x11/mod.rs b/src/x11/mod.rs index 0f5f5575..315c2b30 100644 --- a/src/x11/mod.rs +++ b/src/x11/mod.rs @@ -35,8 +35,9 @@ impl Window { display }; - let screen_id = unsafe { - ffi::XDefaultScreen(display) + let screen_id = match builder.monitor { + Some(MonitorID(monitor)) => monitor as i32, + None => unsafe { ffi::XDefaultScreen(display) }, }; // getting the FBConfig diff --git a/src/x11/monitor.rs b/src/x11/monitor.rs index f1b861bf..3b382c2f 100644 --- a/src/x11/monitor.rs +++ b/src/x11/monitor.rs @@ -1,7 +1,7 @@ use std::{ptr}; use super::ffi; -pub struct MonitorID(uint); +pub struct MonitorID(pub uint); pub fn get_available_monitors() -> Vec { let nb_monitors = unsafe {