macOS accessory mode
This commit is contained in:
@@ -11,6 +11,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
state::init_app_state,
|
state::init_app_state,
|
||||||
system_tray::init_system_tray,
|
system_tray::init_system_tray,
|
||||||
|
utilities::toggle_macos_accessory_mode,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub mod lifecycle;
|
pub mod lifecycle;
|
||||||
@@ -20,6 +21,7 @@ pub mod tracing;
|
|||||||
/// init and startup of everything.
|
/// init and startup of everything.
|
||||||
pub async fn launch_app() {
|
pub async fn launch_app() {
|
||||||
init_logging();
|
init_logging();
|
||||||
|
toggle_macos_accessory_mode(false); // TODO: toggle true once figure out consolidated window management solution
|
||||||
open_splash_window();
|
open_splash_window();
|
||||||
update_app().await;
|
update_app().await;
|
||||||
init_app_state();
|
init_app_state();
|
||||||
|
|||||||
@@ -27,3 +27,19 @@ macro_rules! lock_w {
|
|||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn toggle_macos_accessory_mode(enabled: bool) {
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
{
|
||||||
|
use crate::get_app_handle;
|
||||||
|
|
||||||
|
let app = get_app_handle();
|
||||||
|
if enabled {
|
||||||
|
app.set_activation_policy(tauri::ActivationPolicy::Accessory)
|
||||||
|
.expect("Failed to set activation policy to accessory mode");
|
||||||
|
} else {
|
||||||
|
app.set_activation_policy(tauri::ActivationPolicy::Regular)
|
||||||
|
.expect("Failed to set activation policy to regular mode");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user