diff --git a/src/platform/android/mod.rs b/src/platform/android/mod.rs index 98f6d76b..ec08713d 100644 --- a/src/platform/android/mod.rs +++ b/src/platform/android/mod.rs @@ -15,6 +15,7 @@ use std::collections::VecDeque; use CursorState; use WindowAttributes; +use FullScreenState; use native_monitor::NativeMonitorId; gen_api_transition!(); @@ -24,7 +25,7 @@ pub struct Window { event_rx: Receiver, } -#[derive(Clone, PartialEq)] +#[derive(Clone)] pub struct MonitorId; mod ffi; @@ -266,7 +267,7 @@ impl Window { } #[inline] - pub fn set_fullscreen_windowed(&self, fullscreen: bool) { + pub fn set_fullscreen(&self, state: FullScreenState) { } } diff --git a/src/platform/ios/mod.rs b/src/platform/ios/mod.rs index 716adcb1..5235451f 100644 --- a/src/platform/ios/mod.rs +++ b/src/platform/ios/mod.rs @@ -71,7 +71,7 @@ use objc::runtime::{Class, Object, Sel, BOOL, YES }; use objc::declare::{ ClassDecl }; use native_monitor::NativeMonitorId; -use { CreationError, CursorState, MouseCursor, WindowAttributes }; +use { CreationError, CursorState, MouseCursor, WindowAttributes, FullScreenState }; use WindowEvent as Event; use events::{ Touch, TouchPhase }; @@ -94,7 +94,7 @@ use self::ffi::{ static mut jmpbuf: [c_int;27] = [0;27]; -#[derive(Clone, PartialEq)] +#[derive(Clone)] pub struct MonitorId; pub struct Window { @@ -454,7 +454,7 @@ impl Window { } #[inline] - pub fn set_fullscreen_windowed(&self, fullscreen: bool) { + pub fn set_fullscreen(&self, state: FullScreenState) { } } diff --git a/src/platform/linux/mod.rs b/src/platform/linux/mod.rs index 3cb2c814..a88d7f81 100644 --- a/src/platform/linux/mod.rs +++ b/src/platform/linux/mod.rs @@ -97,7 +97,7 @@ pub enum DeviceId { Wayland(wayland::DeviceId) } -#[derive(Clone, PartialEq)] +#[derive(Clone)] pub enum MonitorId { #[doc(hidden)] X(x11::MonitorId), diff --git a/src/platform/linux/wayland/context.rs b/src/platform/linux/wayland/context.rs index 90aad34e..98367bbf 100644 --- a/src/platform/linux/wayland/context.rs +++ b/src/platform/linux/wayland/context.rs @@ -359,12 +359,6 @@ pub struct MonitorId { ctxt: Arc } -impl PartialEq for MonitorId { - fn eq(&self, other: &MonitorId) -> bool { - self.id == other.id - } -} - impl MonitorId { pub fn get_name(&self) -> Option { let mut guard = self.ctxt.evq.lock().unwrap(); diff --git a/src/platform/linux/x11/monitor.rs b/src/platform/linux/x11/monitor.rs index 392f0a4f..d6479c91 100644 --- a/src/platform/linux/x11/monitor.rs +++ b/src/platform/linux/x11/monitor.rs @@ -6,11 +6,6 @@ use native_monitor::NativeMonitorId; #[derive(Clone)] pub struct MonitorId(pub Arc, pub u32); -impl PartialEq for MonitorId { - fn eq(&self, other: &MonitorId) -> bool { - self.1 == other.1 - } -} pub fn get_available_monitors(x: &Arc) -> VecDeque { let nb_monitors = unsafe { (x.xlib.XScreenCount)(x.display) }; diff --git a/src/platform/macos/monitor.rs b/src/platform/macos/monitor.rs index fa4f3b65..22df205c 100644 --- a/src/platform/macos/monitor.rs +++ b/src/platform/macos/monitor.rs @@ -2,7 +2,7 @@ use core_graphics::display; use std::collections::VecDeque; use native_monitor::NativeMonitorId; -#[derive(Clone, PartialEq)] +#[derive(Clone)] pub struct MonitorId(u32); pub fn get_available_monitors() -> VecDeque { diff --git a/src/platform/macos/window.rs b/src/platform/macos/window.rs index a3e2beb2..f6131d43 100644 --- a/src/platform/macos/window.rs +++ b/src/platform/macos/window.rs @@ -3,6 +3,7 @@ use CreationError::OsError; use libc; use WindowAttributes; +use FullScreenState; use native_monitor::NativeMonitorId; use os::macos::ActivationPolicy; use os::macos::WindowExt; @@ -643,7 +644,7 @@ impl Window { } #[inline] - pub fn set_fullscreen_windowed(&self, fullscreen: bool) { + pub fn set_fullscreen(&self, state: FullScreenState) { } } diff --git a/src/platform/windows/monitor.rs b/src/platform/windows/monitor.rs index 07094524..297e8261 100644 --- a/src/platform/windows/monitor.rs +++ b/src/platform/windows/monitor.rs @@ -34,12 +34,6 @@ pub struct MonitorId { dimensions: (u32, u32), } -impl PartialEq for MonitorId { - fn eq(&self, other: &MonitorId) -> bool { - self.monitor_name == other.monitor_name - } -} - struct DeviceEnumerator { parent_device: *const winapi::WCHAR, current_index: u32, diff --git a/src/platform/windows/window.rs b/src/platform/windows/window.rs index 65373323..89221ade 100644 --- a/src/platform/windows/window.rs +++ b/src/platform/windows/window.rs @@ -20,6 +20,7 @@ use CreationError; use CursorState; use MouseCursor; use WindowAttributes; +use FullScreenState; use dwmapi; use kernel32; @@ -282,7 +283,7 @@ impl Window { } #[inline] - pub fn set_fullscreen_windowed(&self, fullscreen: bool) { + pub fn set_fullscreen(&self, state: FullScreenState) { } } @@ -329,7 +330,7 @@ unsafe fn init(window: WindowAttributes, pl_attribs: PlatformSpecificWindowBuild // and change the monitor's resolution if necessary if let Some(ref monitor) = window.fullscreen.get_monitor() { try!(switch_to_fullscreen(&mut rect, monitor)); - } + }; let fullscreen = window.fullscreen.get_monitor().is_some(); diff --git a/src/window.rs b/src/window.rs index 36b94859..19ebc753 100644 --- a/src/window.rs +++ b/src/window.rs @@ -370,7 +370,7 @@ pub fn get_primary_monitor() -> MonitorId { } /// Identifier for a monitor. -#[derive(Clone, PartialEq)] +#[derive(Clone)] pub struct MonitorId(pub platform::MonitorId); impl MonitorId {