Skip to content

Conversation

@1111mp
Copy link
Contributor

@1111mp 1111mp commented Apr 9, 2025

Add set_dock_visibility method to support setting the visibility of the application in the dock.

With the upstream PR(tauri-apps/tao#1058) merged, I think it's time for tauri to support it. Even though we already have set_activation_policy. Here’s the difference from ChatGPT about how they are implemented:


Detailed Comparison

TransformProcessType(set_dock_visibility):

  • Functionality: Used to change the process type, such as making an application a UI element, which does not show up in the Dock.
  • Flexibility: Allows dynamic state changes of the application, suitable for apps needing runtime display adjustments.
  • Complexity: Requires handling more details and potential system errors, especially during rapid state transitions.
  • Use Case: Suitable for applications needing to hide or show the Dock icon under specific conditions, like background tools.

NSApplicationActivationPolicy:

  • Functionality: Controls the application's Dock display and menu bar presence by setting the activation policy.
  • Simplicity: Directly sets the activation policy, straightforward and easy to implement.
  • Safety: Fewer risks of system errors, suitable for most applications.
  • Use Case: Suitable for applications that do not require frequent dynamic changes to Dock display status.

Comparison Table

Feature/Functionality TransformProcessType NSApplicationActivationPolicy
Control Method Controls by changing process type Controls by setting application activation policy
Flexibility High: Can dynamically change application state Low: Typically set at application launch, not easily dynamic
Implementation Complexity High: Requires handling process transformation details and potential issues Low: Simple to set, easy to implement
Error Risk High: Potential system errors with rapid state changes (e.g., multiple Dock icons) Low: Generally safe and reliable
Applicable Scenarios Apps needing dynamic Dock icon visibility Standard applications needing simple Dock visibility control
Usage Examples Background tools, auxiliary applications Standard applications like text editors, browsers, etc

This comparison shows that TransformProcessType offers higher flexibility but comes with increased complexity and error risk, whereas NSApplicationActivationPolicy provides a simpler, safer way to control an application's Dock visibility. The choice between the two should be based on the specific needs of the application.

Signed-off-by: The1111mp <The1111mp@outlook.com>
@1111mp 1111mp requested a review from a team as a code owner April 9, 2025 09:23
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Apr 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 9, 2025

Package Changes Through 5c6a03d

There are 5 changes which include tauri-bundler with patch, tauri with minor, tauri-runtime with minor, tauri-runtime-wry with minor, @tauri-apps/api with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.4.1 2.5.0
tauri-bundler 2.3.1 2.3.2
tauri-runtime 2.5.1 2.6.0
tauri-runtime-wry 2.5.1 2.6.0
tauri 2.4.1 2.5.0
@tauri-apps/cli 2.4.1 2.4.2
tauri-cli 2.4.1 2.4.2

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars FabianLars added this to the 2.5 milestone Apr 9, 2025
@lucasfernog lucasfernog merged commit dd4f13c into tauri-apps:dev Apr 11, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

Development

Successfully merging this pull request may close these issues.

3 participants