Skip to content

Conversation

@petersamokhin
Copy link
Contributor

Hello there! Thanks a lot for Tauri.

This PR exposes the internal TrayIcon to be able to access the platform implementations.
This is pretty important and my use case is to access the underlying ns_status_item() (and then NSWindow, and then NSScreen). TrayIcon already exposes that, but it's unavailable if using the Tauri plugin.

@petersamokhin petersamokhin requested a review from a team as a code owner August 7, 2025 00:56
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Aug 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2025

Package Changes Through 714aa60

There are 10 changes which include tauri with minor, tauri-cli with minor, @tauri-apps/cli with minor, tauri-utils with minor, tauri-bundler with minor, tauri-macos-sign with minor, tauri-runtime-wry with minor, @tauri-apps/api with minor, tauri-runtime with minor, tauri-plugin 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.7.0 2.8.0
tauri-utils 2.6.0 2.7.0
tauri-macos-sign 2.1.0 2.2.0
tauri-bundler 2.5.2 2.6.0
tauri-runtime 2.7.1 2.8.0
tauri-runtime-wry 2.7.2 2.8.0
tauri-codegen 2.3.1 2.3.2
tauri-macros 2.3.2 2.3.3
tauri-plugin 2.3.1 2.4.0
tauri-build 2.3.1 2.3.2
tauri 2.7.0 2.8.0
@tauri-apps/cli 2.7.1 2.8.0
tauri-cli 2.7.1 2.8.0

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
Copy link
Member

Thanks for the PR! Would you mind adding a comment similar to the one we have here? https://docs.rs/tauri/latest/tauri/webview/struct.WebviewWindow.html#method.with_webview If we expose the TrayIcon instance like this updating tray-icon would be a breaking change strictly speaking.
A comment about the main thread requirement when interacting with the instance would probably be nice to have too.

Also, I'd appreciate a changefile (check the .changes dir for examples) :)

@petersamokhin
Copy link
Contributor Author

@FabianLars definitely makes sense, thanks for noting! I added the changes document, and also updated the newly introduced fn to follow the with_webview approach that also explicitly handles the main thread.

There's one little difference from with_webview: the new fn returns whatever the passed f returns, instead of always returning (), just for convenience. Consumers still can return () if they wish but do it explicitly (even with a ;). Let me know if you want this changed, not insisting here.

Thanks for the prompt response!

@petersamokhin
Copy link
Contributor Author

Fixed the build — somehow an import was removed from tests, reverted 🤷

@Legend-Master Legend-Master added this to the 2.8 milestone Aug 16, 2025
Legend-Master
Legend-Master previously approved these changes Aug 16, 2025
@Legend-Master Legend-Master merged commit f123267 into tauri-apps:dev Aug 16, 2025
29 of 30 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap Aug 16, 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