Skip to content
Open
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
18 changes: 15 additions & 3 deletions apps/desktop/src-tauri/src/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,12 @@ fn macos_sync_activation_policy(app: &tauri::AppHandle, should_show_dock: bool)
pub(crate) fn prepare_macos_panel_window(
app: &tauri::AppHandle,
) -> MacosPanelWindowActivationGuard {
MACOS_PENDING_PANEL_WINDOWS.fetch_add(1, Ordering::AcqRel);
let prev = MACOS_PENDING_PANEL_WINDOWS.fetch_add(1, Ordering::AcqRel);

if let Err(err) = app.set_activation_policy(tauri::ActivationPolicy::Accessory) {
tracing::warn!("Failed to prepare macOS panel activation policy: {err}");
if prev == 0 {
if let Err(err) = app.set_activation_policy(tauri::ActivationPolicy::Accessory) {
tracing::warn!("Failed to prepare macOS panel activation policy: {err}");
}
}

MacosPanelWindowActivationGuard { app: app.clone() }
Expand All @@ -177,6 +179,16 @@ pub(crate) fn sync_macos_dock_visibility(app: &tauri::AppHandle) {
return;
}

let has_visible_panel_window = app.webview_windows().iter().any(|(label, window)| {
CapWindowId::from_str(label)
.map(|id| !id.activates_dock() && window.is_visible().unwrap_or(false))
.unwrap_or(false)
});

if has_visible_panel_window {
return;
}

let should_hide_dock = GeneralSettingsStore::get(app)
.ok()
.flatten()
Expand Down
Loading