Implement ability to make non-activating window on macOS (#4035)

Fixes #3894
This commit is contained in:
Exidex 2024-12-13 00:56:39 +01:00 committed by GitHub
parent 5835c9102e
commit 4d5e68c6e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 86 additions and 37 deletions

View file

@ -332,6 +332,13 @@ pub trait WindowAttributesExtMacOS {
fn with_borderless_game(self, borderless_game: bool) -> Self;
/// See [`WindowExtMacOS::set_unified_titlebar`] for details on what this means if set.
fn with_unified_titlebar(self, unified_titlebar: bool) -> Self;
/// Use [`NSPanel`] window with [`NonactivatingPanel`] window style mask instead of
/// [`NSWindow`].
///
/// [`NSWindow`]: https://developer.apple.com/documentation/appkit/NSWindow?language=objc
/// [`NSPanel`]: https://developer.apple.com/documentation/appkit/NSPanel?language=objc
/// [`NonactivatingPanel`]: https://developer.apple.com/documentation/appkit/nswindow/stylemask-swift.struct/nonactivatingpanel?language=objc
fn with_panel(self, panel: bool) -> Self;
}
impl WindowAttributesExtMacOS for WindowAttributes {
@ -412,6 +419,12 @@ impl WindowAttributesExtMacOS for WindowAttributes {
self.platform_specific.unified_titlebar = unified_titlebar;
self
}
#[inline]
fn with_panel(mut self, panel: bool) -> Self {
self.platform_specific.panel = panel;
self
}
}
pub trait EventLoopBuilderExtMacOS {