-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
macOS: Expose new Tao APIs #3840
Conversation
core/tauri-runtime/src/lib.rs
Outdated
@@ -528,6 +529,21 @@ pub trait Dispatch<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'static | |||
/// Hides the window. | |||
fn hide(&self) -> Result<()>; | |||
|
|||
/// Shows the application on MacOS (independent of current window). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some more explanations would be helpful here, what does hiding the app mean in detail? Does it affect the dock icon? Does it affect Mission Control? Or the app quick switcher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to, but the only way to know would be experimental. Apple is deliberately vague about this, probably because things like dock and mission control are subject to changes across MacOS versions. Being more detailed than Apple's own docs won't be much help. Here's an example of what we call show_application
:
https://developer.apple.com/documentation/appkit/nsapplication/1428761-unhide?language=objc
This is the same as #3689, we won't merge this anytime soon. These api will have to wait for v2. |
@amrbashir noted, and sorry for creating yet another duplicate PR. Same story, I didn't know this was already implemented. For context, these features are important for MacOS apps to behave in line with user expectations, that's likely why we both arrived at the same features. Are we blocked due to feature freeze for 1.0 or because we haven't yet approved the API design? If the latter, we could parallelize the design discussions without putting load on the team. Note the difference between this PR and #3689:
|
It is blocked because we can't introduce new APIs that isn't audited so it will have to wait for v2 so it can be audited. |
Co-authored-by: Lorenzo Lewis <[email protected]>
These changes exposes Tao APIs that are only affecting MacOS:
Window.show_application()
Window.hide_application()
Window.set_application_policy_at_runtime(..)
Following precedent set by
set_activation_policy
, these APIs are all target-gated to MacOS only.What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___
)Other information
Related to #2358.