mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
feat: add Window::is_visible (#2169)
* feat: add `Window::is_visible` * use `Option<bool>` * update doc * move it right after `set_visible`
This commit is contained in:
@@ -502,6 +502,12 @@ impl UnownedWindow {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_visible(&self) -> Option<bool> {
|
||||
let is_visible: BOOL = unsafe { msg_send![*self.ns_window, isVisible] };
|
||||
Some(is_visible == YES)
|
||||
}
|
||||
|
||||
pub fn request_redraw(&self) {
|
||||
AppState::queue_redraw(RootWindowId(self.id()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user