tao icon indicating copy to clipboard operation
tao copied to clipboard

[feat] Set GTK Application ID

Open codifryed opened this issue 9 months ago • 2 comments

Description:

I noticed a few strange quirks with my application and tracked it down to the fact that the Tao library sets the application ID always to None for the GTK implementation and therefor ends up defaulting to the executable's name. (can be verified with wayland_debug=client and changing the binary name). Code reference example: https://github.com/tauri-apps/tao/blob/9ecac8119b0a2baf58caa43a29129741daa4b1e4/src/platform_impl/linux/event_loop.rs#L193

That sometimes works out, but not always and can lead to conflicts. Additionally the application_id is used for several things depending your one's DE, and as such is recommended to be set per best practice specification:

Gnome/GTK: https://teams.pages.gitlab.gnome.org/Websites/developer.gnome.org/documentation/tutorials/application-id.html#application-id Wayland: https://wayland.app/protocols/xdg-shell#xdg_toplevel:request:set_app_id KDE reference: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1317

The GTK rust crate also sets the application_id in it's examples.

Admittedly there may be a good reason Tao does this, but it would be beneficial and helpful to be able to set a proper value.

Solution I'd like:

I would like to be able to set the GTK Application ID. For example perhaps as a new field in the tauri.conf.json or programmatically when instantiating the application, i.e.: app.set_app_id("org.gnome.ThisApp")

codifryed avatar Apr 28 '24 21:04 codifryed

Thanks for bringing this to our attention, I will open a PR to expose an API in tao but tauri will probably just set it to the identifier defined in tauri.conf.json without exposing the API.

amrbashir avatar Apr 29 '24 21:04 amrbashir

Thanks @amrbashir!

Using the defined identifier in the conf I think is fine. I wasn't originally sure of that option because that's part of the BundleConfig and would then affect a non-bundle setting. Semantics. 😄 Happy to see this set in any regard.

codifryed avatar Apr 30 '24 07:04 codifryed

Using the defined identifier in the conf I think is fine. I wasn't originally sure of that option because that's part of the BundleConfig and would then affect a non-bundle setting. Semantics. 😄 Happy to see this set in any regard.

In v2, the identifier was moved to the root of the tauri.conf.json because of things like this.

amrbashir avatar Apr 30 '24 12:04 amrbashir

Aha! 👍🏼 nice.

codifryed avatar Apr 30 '24 12:04 codifryed