mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
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:
@@ -618,6 +618,11 @@ impl WindowExt for Window2 {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_simple_fullscreen(&self) -> bool {
|
||||
self.delegate.state.is_simple_fullscreen.get()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn set_simple_fullscreen(&self, fullscreen: bool) -> bool {
|
||||
let state = &self.delegate.state;
|
||||
@@ -1137,6 +1142,14 @@ impl Window2 {
|
||||
self.delegate.state.perform_maximized(maximized)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_fullscreen(&self) -> Option<RootMonitorId> {
|
||||
let state = &self.delegate.state;
|
||||
let win_attribs = state.win_attribs.borrow();
|
||||
|
||||
win_attribs.fullscreen.clone()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// TODO: Right now set_fullscreen do not work on switching monitors
|
||||
/// in fullscreen mode
|
||||
|
||||
Reference in New Issue
Block a user