@@ -23,8 +23,6 @@ use tauri_runtime::window::MenuEvent;
23
23
use tauri_runtime:: { SystemTray , SystemTrayEvent } ;
24
24
#[ cfg( windows) ]
25
25
use winapi:: shared:: windef:: HWND ;
26
- #[ cfg( target_os = "macos" ) ]
27
- use wry:: application:: platform:: macos:: WindowExtMacOS ;
28
26
#[ cfg( all( feature = "system-tray" , target_os = "macos" ) ) ]
29
27
use wry:: application:: platform:: macos:: { SystemTrayBuilderExtMacOS , SystemTrayExtMacOS } ;
30
28
#[ cfg( target_os = "linux" ) ]
@@ -68,10 +66,11 @@ pub use wry::application::window::{Window, WindowBuilder as WryWindowBuilder, Wi
68
66
use wry:: webview:: WebviewExtWindows ;
69
67
70
68
#[ cfg( target_os = "macos" ) ]
71
- use tauri_runtime:: menu:: NativeImage ;
69
+ use tauri_runtime:: { menu:: NativeImage , ActivationPolicy } ;
72
70
#[ cfg( target_os = "macos" ) ]
73
71
pub use wry:: application:: platform:: macos:: {
74
- CustomMenuItemExtMacOS , NativeImage as WryNativeImage ,
72
+ ActivationPolicy as WryActivationPolicy , CustomMenuItemExtMacOS , EventLoopExtMacOS ,
73
+ NativeImage as WryNativeImage , WindowExtMacOS ,
75
74
} ;
76
75
77
76
use std:: {
@@ -1653,6 +1652,18 @@ impl Runtime for Wry {
1653
1652
id
1654
1653
}
1655
1654
1655
+ #[ cfg( target_os = "macos" ) ]
1656
+ fn set_activation_policy ( & mut self , activation_policy : ActivationPolicy ) {
1657
+ self
1658
+ . event_loop
1659
+ . set_activation_policy ( match activation_policy {
1660
+ ActivationPolicy :: Regular => WryActivationPolicy :: Regular ,
1661
+ ActivationPolicy :: Accessory => WryActivationPolicy :: Accessory ,
1662
+ ActivationPolicy :: Prohibited => WryActivationPolicy :: Prohibited ,
1663
+ _ => unimplemented ! ( ) ,
1664
+ } ) ;
1665
+ }
1666
+
1656
1667
#[ cfg( any( target_os = "windows" , target_os = "macos" ) ) ]
1657
1668
fn run_iteration < F : Fn ( RunEvent ) + ' static > ( & mut self , callback : F ) -> RunIteration {
1658
1669
use wry:: application:: platform:: run_return:: EventLoopExtRunReturn ;
0 commit comments