Rework MonitorId::get_native_identifier (#267)

* Rework MonitorId::get_native_identifier

* Try fix compilation

* Returns the monitor ID on wayland as well

* Try fix compilation

* Fix iOS compilation
This commit is contained in:
tomaka 2017-08-30 08:49:18 +02:00 committed by GitHub
parent f7a8bcddb8
commit 7dc6fcdedc
16 changed files with 67 additions and 69 deletions

View file

@ -4,8 +4,6 @@ use user32;
use std::collections::VecDeque;
use std::mem;
use native_monitor::NativeMonitorId;
/// Win32 implementation of the main `MonitorId` object.
#[derive(Clone)]
pub struct MonitorId {
@ -158,8 +156,8 @@ impl MonitorId {
/// See the docs of the crate root file.
#[inline]
pub fn get_native_identifier(&self) -> NativeMonitorId {
NativeMonitorId::Name(self.monitor_name.clone())
pub fn get_native_identifier(&self) -> String {
self.monitor_name.clone()
}
/// See the docs if the crate root file.

View file

@ -329,8 +329,8 @@ unsafe fn init(window: WindowAttributes, pl_attribs: PlatformSpecificWindowBuild
// switching to fullscreen if necessary
// this means adjusting the window's position so that it overlaps the right monitor,
// and change the monitor's resolution if necessary
let fullscreen = if let FullScreenState::Exclusive(RootMonitorId(ref monitor)) = window.fullscreen {
try!(switch_to_fullscreen(&mut rect, monitor));
let fullscreen = if let FullScreenState::Exclusive(RootMonitorId { ref inner }) = window.fullscreen {
try!(switch_to_fullscreen(&mut rect, inner));
true
} else {
false