Changed is_fullscreen to monitor.is_some()

This commit is contained in:
DavidPartouche 2014-09-18 14:03:03 +02:00 committed by Tomaka17
parent b149fca83d
commit bd3b06e1a5
3 changed files with 3 additions and 5 deletions

View file

@ -58,7 +58,6 @@ pub struct WindowBuilder {
title: String, title: String,
monitor: Option<winimpl::MonitorID>, monitor: Option<winimpl::MonitorID>,
gl_version: Option<(uint, uint)>, gl_version: Option<(uint, uint)>,
is_fullscreen: bool,
} }
impl WindowBuilder { impl WindowBuilder {
@ -69,7 +68,6 @@ impl WindowBuilder {
title: "gl-init-rs window".to_string(), title: "gl-init-rs window".to_string(),
monitor: None, monitor: None,
gl_version: None, gl_version: None,
is_fullscreen: false,
} }
} }
@ -93,7 +91,6 @@ impl WindowBuilder {
pub fn with_fullscreen(mut self, monitor: MonitorID) -> WindowBuilder { pub fn with_fullscreen(mut self, monitor: MonitorID) -> WindowBuilder {
let MonitorID(monitor) = monitor; let MonitorID(monitor) = monitor;
self.monitor = Some(monitor); self.monitor = Some(monitor);
self.is_fullscreen = true;
self self
} }

View file

@ -1426,6 +1426,7 @@ extern "C" {
pub fn glXSwapBuffers(dpy: *mut Display, drawable: GLXDrawable); pub fn glXSwapBuffers(dpy: *mut Display, drawable: GLXDrawable);
pub fn XkbSetDetectableAutoRepeat(dpy: *mut Display, detectable: bool, supported_rtm: *mut bool) -> bool; pub fn XkbSetDetectableAutoRepeat(dpy: *mut Display, detectable: bool, supported_rtm: *mut bool) -> bool;
pub fn XF86VidModeSwitchToMode(dpy: *mut Display, screen: libc::c_int, pub fn XF86VidModeSwitchToMode(dpy: *mut Display, screen: libc::c_int,
modeline: *mut XF86VidModeModeInfo) -> Bool; modeline: *mut XF86VidModeModeInfo) -> Bool;
pub fn XF86VidModeSetViewPort(dpy: *mut Display, screen: libc::c_int, pub fn XF86VidModeSetViewPort(dpy: *mut Display, screen: libc::c_int,

View file

@ -148,7 +148,7 @@ impl Window {
}; };
let mut window_attributes = ffi::CWBorderPixel | ffi::CWColormap | ffi:: CWEventMask; let mut window_attributes = ffi::CWBorderPixel | ffi::CWColormap | ffi:: CWEventMask;
if builder.is_fullscreen { if builder.monitor.is_some() {
window_attributes |= ffi::CWOverrideRedirect; window_attributes |= ffi::CWOverrideRedirect;
unsafe { unsafe {
ffi::XF86VidModeSwitchToMode(display, screen_id, *modes.offset(best_mode as int)); ffi::XF86VidModeSwitchToMode(display, screen_id, *modes.offset(best_mode as int));
@ -270,7 +270,7 @@ impl Window {
wm_delete_window: wm_delete_window, wm_delete_window: wm_delete_window,
xf86_desk_mode: xf86_desk_mode, xf86_desk_mode: xf86_desk_mode,
screen_id: screen_id, screen_id: screen_id,
is_fullscreen: builder.is_fullscreen, is_fullscreen: builder.monitor.is_some(),
}; };
// calling glViewport // calling glViewport