Feat/fullscreen getters (#838)

* feat: [macos] add get_fullscreen and get_simple_fullscreen

* feat: [windows] add get_fullscreen

* feat: [ios] add get_fullscreen

* feat: [android] add get_fullscreen

* feat: [emscripten] add get_fullscreen

* feat: [linux] add get_fullscreen

* feedback: `get_fullscreen() -> bool` -> `get_fullscreen() -> Option<Id>`
This commit is contained in:
acheronfail 2019-04-26 03:09:32 +10:00 committed by Victor Berger
parent fa99b9ff5a
commit 062e0e52ee
11 changed files with 96 additions and 3 deletions

View file

@ -38,6 +38,7 @@ pub struct SharedState {
pub guessed_dpi: Option<f64>,
pub last_monitor: Option<X11MonitorHandle>,
pub dpi_adjusted: Option<(f64, f64)>,
pub fullscreen: Option<RootMonitorHandle>,
// Used to restore position after exiting fullscreen.
pub restore_position: Option<(i32, i32)>,
pub frame_extents: Option<util::FrameExtentsHeuristic>,
@ -536,8 +537,14 @@ impl UnownedWindow {
}
}
#[inline]
pub fn get_fullscreen(&self) -> Option<RootMonitorHandle> {
self.shared_state.lock().fullscreen.clone()
}
#[inline]
pub fn set_fullscreen(&self, monitor: Option<RootMonitorHandle>) {
self.shared_state.lock().fullscreen = monitor.clone();
self.set_fullscreen_inner(monitor)
.flush()
.expect("Failed to change window fullscreen state");