Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions winit-appkit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ pub struct WindowAttributesMacOS {
pub(crate) borderless_game: bool,
pub(crate) unified_titlebar: bool,
pub(crate) panel: bool,
pub(crate) simple_fullscreen: bool,
}

impl WindowAttributesMacOS {
Expand Down Expand Up @@ -437,6 +438,12 @@ impl WindowAttributesMacOS {
self
}

/// See [`WindowExtMacOS::set_simple_fullscreen`] for details on what this means if set.
pub fn with_simple_fullscreen(mut self, simple_fullscreen: bool) -> Self {
self.simple_fullscreen = simple_fullscreen;
self
}

/// Use [`NSPanel`] window with [`NonactivatingPanel`] window style mask instead of
/// [`NSWindow`].
///
Expand Down Expand Up @@ -468,6 +475,7 @@ impl Default for WindowAttributesMacOS {
borderless_game: false,
unified_titlebar: false,
panel: false,
simple_fullscreen: false,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions winit-appkit/src/window_delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,8 @@ impl WindowDelegate {
// Set fullscreen mode after we setup everything
delegate.set_fullscreen(attrs.fullscreen);

delegate.set_simple_fullscreen(macos_attrs.simple_fullscreen);

// Setting the window as key has to happen *after* we set the fullscreen
// state, since otherwise we'll briefly see the window at normal size
// before it transitions.
Expand Down
1 change: 1 addition & 0 deletions winit/src/changelog/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on how to add them:
- On X11, add `Window::even_more_rare_api`.
- On Wayland, add `Window::common_api`.
- On Windows, add `Window::some_rare_api`.
- On macOS, add `WindowAttributesMacOS::with_simple_fullscreen`.
```

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