Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]MacOS中关闭应用窗口然后Docker栏中图标不会隐藏 #132

Open
nelsontech opened this issue Oct 29, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@nelsontech
Copy link

MacOS中关闭应用窗口然后Docker栏中图标不会隐藏

@nelsontech nelsontech added the enhancement New feature or request label Oct 29, 2024
@1111mp
Copy link
Owner

1111mp commented Oct 29, 2024

之前使用electron的时候这个功能已经实现了,但是迁移到tauri之后,tauri目前还不支持直接操作dock的相关api,详情可以查看:tauri-apps/tao#105

当然有一种方式可以在运行程序的时候在dock中不展示图标,https://github.com/tauri-apps/tauri/discussions/6093:

app.set_activation_policy(ActivationPolicy::Accessory);

关于设置的详细文档可以参考:https://developer.apple.com/documentation/appkit/nsapplication/activationpolicy

Activation Policies
case regular
The application is an ordinary app that appears in the Dock and may have a user interface.
case accessory
The application doesn’t appear in the Dock and doesn’t have a menu bar, but it may be activated programmatically or by clicking on one of its windows.
case prohibited
The application doesn’t appear in the Dock and may not create windows or be activated.

在设置成ActivationPolicy::Accessory之后,当其它应用处于全屏模式时,会运行在这个应用的窗口中,而不是主界面;还有就是macos的台前调度对其也无法管理。

所以这个得等到tauri支持。

@nelsontech
Copy link
Author

好嘞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants