DioxusLabs / DioxusLabs/dioxus

macos: hide application from dock

Open
#4,435 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

## Feature Request

There is no obvious way to hide an application from the dock on macOS. A number of conventional things like modifying the Info.plist file to include `LSUIElement` don't work. The only way I've found, after hours of fiddling, is to use `dioxus::desktop::tao` directly, then do something like this:

```rust
use dioxus::desktop::tao::platform::macos::{ActivationPolicy, EventLoopWindowTargetExtMacOS};

let dioxus_config = DioxusConfig::new()
.with_custom_event_handler(|_event, event_loop_target| {
// Set activation policy to Accessory on macOS to prevent dock icon
#[cfg(target_os = "macos")]
{
static POLICY_SET: std::sync::Once = std::sync::Once::new();
POLICY_SET.call_once(|| {
event_loop_target
.set_activation_policy_at_runtime(ActivationPolicy::Accessory);
});
}
});
```

I'm only just exploring Dioxus, so it's possible that I'm missing something.

## Implement Suggestion

There should be a single, documented, supported way to hide apps from the dock. I'm agnostic about the exact phrasing of this, as long as it exists.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.