pub trait WindowExt {
// Required methods
fn get_nswindow(&self) -> *mut c_void;
fn get_nsview(&self) -> *mut c_void;
fn request_user_attention(&self, is_critical: bool);
fn get_simple_fullscreen(&self) -> bool;
fn set_simple_fullscreen(&self, fullscreen: bool) -> bool;
}
Expand description
Additional methods on Window
that are specific to MacOS.
Required Methods§
sourcefn get_nswindow(&self) -> *mut c_void
fn get_nswindow(&self) -> *mut c_void
Returns a pointer to the cocoa NSWindow
that is used by this window.
The pointer will become invalid when the Window
is destroyed.
sourcefn get_nsview(&self) -> *mut c_void
fn get_nsview(&self) -> *mut c_void
Returns a pointer to the cocoa NSView
that is used by this window.
The pointer will become invalid when the Window
is destroyed.
sourcefn request_user_attention(&self, is_critical: bool)
fn request_user_attention(&self, is_critical: bool)
Request user attention, causing the application’s dock icon to bounce. Note that this has no effect if the application is already focused.
The is_critical
flag has the following effects:
false
: the dock icon will only bounce once.true
: the dock icon will bounce until the application is focused.
sourcefn get_simple_fullscreen(&self) -> bool
fn get_simple_fullscreen(&self) -> bool
Returns whether or not the window is in simple fullscreen mode.
sourcefn set_simple_fullscreen(&self, fullscreen: bool) -> bool
fn set_simple_fullscreen(&self, fullscreen: bool) -> bool
Toggles a fullscreen mode that doesn’t require a new macOS space. Returns a boolean indicating whether the transition was successful (this won’t work if the window was already in the native fullscreen).
This is how fullscreen used to work on macOS in versions before Lion. And allows the user to have a fullscreen window without using another space or taking control over the entire monitor.