wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.55k stars 1.24k forks source link

Enable setting the app's activation policy in MacOS #3374

Open philc opened 7 months ago

philc commented 7 months ago

Is your feature request related to a problem? Please describe.

NSApplication has the method setActivationPolicy, which allows the app to configure itself as a regular app, accessory, or "prohibited."

Wails invokes this API in NSApplication.m:

[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];

I'm building an app launcher (replacement for Spotlight) and would like my app to be an accessory, meaning it's hidden from the doc and app switcher.

Describe the solution you'd like

The application object that Wails exposes should have a method which allows the activation policy to be modified at runtime.

leaanthony commented 7 months ago

Hi Phil 👋 Sounds reasonable. It's implemented in v3 alpha so ideally we'd just backport that: https://github.com/wailsapp/wails/blob/cf130a6e2564426b2ab222598cd452e68e8a62bd/v3/pkg/application/application_options.go#L131

If you fancy a go at it, let us know otherwise I can add it to the list.

kishorkumar287 commented 3 months ago

can we have it in wails v2