Open OceanBelongsToMe opened 2 years ago
Hard to say what you mean because you didn't say much. Windows don't show up in the macOS Dock, so window.set_skip_taskbar
isn't something that works on macOS. If you're talking about hiding the app from the Dock, that's mentioned in https://github.com/tauri-apps/tauri/issues/2258
It is not possible for macOS so I will rename this issue to dock management.
related to tauri-apps/tao#105
My use case, for whoever is looking at this in the future:
The user can control whether the app runs in (a) both foreground and background or (b) foreground only, using a checkbox:
set_activation_policy
almost solves my problem, but:
&mut self
on the App
struct. (I'm not an expert on MacOS, but it appears this should be allowed, perhaps through the AppHandle?)Accessory
, the dock icon is not shown, even if main window is open. (This appears to be MacOS default, so not expecting it to be overridden by Tauri).Check out these commits here:
https://github.com/betamos/tauri/commits/betamos-head
(Relies on an unpublished addition to Tao)
I got everything to work except for one issue:
It works well otherwise, and everything I added is platform-gated with cfg(target_os="macos")
. It's basically a thin layer on top of MacOS APIs. I'd be happy to contribute but someone should probably vet/approve/feedback the approach first.
Instead of using archaic terminology such as set_activation_policy
, I'd prefer adding simpler APIs that exist on all platforms to avoid having to fiddle with platform-gates in business logic. (I suspect a verbose above approach – such as the one above – will result in cargo-cult copy-pasting, so why not make it simpler from the get-go?). Example:
There's some precedent for this in skip_taskbar
, which doesn't apply to MacOS.
set_activation_policy
is an entirely different thing from showing/hiding the dock icon - Keep in mind there are three different activation policies. If you change the activation policy, you should be aware of what it does, so renaming it could potentially be misleading
Yes, I think only regular
and accessory
would apply here. Is there any API you would suggest for dock icon control? I only found transformProcessType
(which is used by Electron) but it seems racey judging by their workarounds.
People have been mentioning transformProcessType
, and it seems like the only option as far as I can tell
It would be nice to be able to dynamically change the dock icon 🙂
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Platform and Versions (required):
Additional context
Add any other context about the problem here.
Stack Trace