Skip to content

Commit e07fb23

Browse files
committed
Add with_simple_fullscreen to WindowAttributesMacOS
1 parent 1e7ab0c commit e07fb23

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

winit-appkit/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ pub struct WindowAttributesMacOS {
341341
pub(crate) borderless_game: bool,
342342
pub(crate) unified_titlebar: bool,
343343
pub(crate) panel: bool,
344+
pub(crate) simple_fullscreen: bool,
344345
}
345346

346347
impl WindowAttributesMacOS {
@@ -437,6 +438,12 @@ impl WindowAttributesMacOS {
437438
self
438439
}
439440

441+
/// See [`WindowExtMacOS::set_simple_fullscreen`] for details on what this means if set.
442+
pub fn with_simple_fullscreen(mut self, simple_fullscreen: bool) -> Self {
443+
self.simple_fullscreen = simple_fullscreen;
444+
self
445+
}
446+
440447
/// Use [`NSPanel`] window with [`NonactivatingPanel`] window style mask instead of
441448
/// [`NSWindow`].
442449
///
@@ -468,6 +475,7 @@ impl Default for WindowAttributesMacOS {
468475
borderless_game: false,
469476
unified_titlebar: false,
470477
panel: false,
478+
simple_fullscreen: false,
471479
}
472480
}
473481
}

winit-appkit/src/window_delegate.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,8 @@ impl WindowDelegate {
847847
// Set fullscreen mode after we setup everything
848848
delegate.set_fullscreen(attrs.fullscreen);
849849

850+
delegate.set_simple_fullscreen(macos_attrs.simple_fullscreen);
851+
850852
// Setting the window as key has to happen *after* we set the fullscreen
851853
// state, since otherwise we'll briefly see the window at normal size
852854
// before it transitions.

winit/src/changelog/unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on how to add them:
1616
- On X11, add `Window::even_more_rare_api`.
1717
- On Wayland, add `Window::common_api`.
1818
- On Windows, add `Window::some_rare_api`.
19+
- On macOS, add `WindowAttributesMacOS::with_simple_fullscreen`.
1920
```
2021

2122
When the change requires non-trivial amount of work for users to comply

0 commit comments

Comments
 (0)