On macOS, add EventLoopBuilderExtMacOS::with_activate_ignoring_other_apps (#2551)
* On macOS, add `EventLoopBuilderExtMacOS::with_activate_ignoring_other_apps` * Update src/platform/macos.rs Co-authored-by: Mads Marquart <mads@marquart.dk> * remove todo Co-authored-by: Mads Marquart <mads@marquart.dk>
This commit is contained in:
parent
ce6c6e8c95
commit
418cc44e93
5 changed files with 34 additions and 5 deletions
|
|
@ -218,6 +218,12 @@ pub trait EventLoopBuilderExtMacOS {
|
|||
/// # }
|
||||
/// ```
|
||||
fn with_default_menu(&mut self, enable: bool) -> &mut Self;
|
||||
|
||||
/// Used to prevent the application from automatically activating when launched if
|
||||
/// another application is already active.
|
||||
///
|
||||
/// The default behavior is to ignore other applications and activate when launched.
|
||||
fn with_activate_ignoring_other_apps(&mut self, ignore: bool) -> &mut Self;
|
||||
}
|
||||
|
||||
impl<T> EventLoopBuilderExtMacOS for EventLoopBuilder<T> {
|
||||
|
|
@ -232,6 +238,12 @@ impl<T> EventLoopBuilderExtMacOS for EventLoopBuilder<T> {
|
|||
self.platform_specific.default_menu = enable;
|
||||
self
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn with_activate_ignoring_other_apps(&mut self, ignore: bool) -> &mut Self {
|
||||
self.platform_specific.activate_ignoring_other_apps = ignore;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Additional methods on [`MonitorHandle`] that are specific to MacOS.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue