diff --git a/.changes/ayatana-feature-refactor.md b/.changes/ayatana-feature-refactor.md new file mode 100644 index 000000000..b4bfca2db --- /dev/null +++ b/.changes/ayatana-feature-refactor.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +**Breaking change:** Removed the `ayatana-tray` from the default features. You must select one of `ayatana-tray` and `gtk-tray` to use system tray on Linux. diff --git a/.changes/expose-global-shortcut.md b/.changes/expose-global-shortcut.md new file mode 100644 index 000000000..f4c4abee1 --- /dev/null +++ b/.changes/expose-global-shortcut.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Re-export the `GlobalShortcutManager` when the `global-shortcut` feature is enabled. diff --git a/.github/workflows/lint-fmt-core.yml b/.github/workflows/lint-fmt-core.yml index f9036ba6a..ab53ce2f9 100644 --- a/.github/workflows/lint-fmt-core.yml +++ b/.github/workflows/lint-fmt-core.yml @@ -50,7 +50,7 @@ jobs: clippy: - { args: '', key: 'empty' } - { - args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,http-multipart', + args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,ayatana-tray,http-multipart', key: 'all' } - { diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index 1ec810372..10a990b43 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -89,4 +89,4 @@ jobs: run: | cargo test cargo test --features api-all - cargo test --features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,http-multipart + cargo test --features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,ayatana-tray,http-multipart diff --git a/.github/workflows/udeps.yml b/.github/workflows/udeps.yml index a22c6ff93..d4e69f0c1 100644 --- a/.github/workflows/udeps.yml +++ b/.github/workflows/udeps.yml @@ -29,7 +29,7 @@ jobs: clippy: - { path: './core/tauri/Cargo.toml', - args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,http-multipart' + args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,ayatana-tray,http-multipart' } - { path: './core/tauri-build/Cargo.toml', args: '--all-features' } - { path: './core/tauri-codegen/Cargo.toml', args: '--all-features' } diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 18cf23512..11c148316 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -122,7 +122,7 @@ tokio = { version = "1.16", features = [ "full" ] } cargo_toml = "0.11" [features] -default = [ "wry", "compression", "objc-exception", "ayatana-tray" ] +default = [ "wry", "compression", "objc-exception" ] compression = [ "tauri-macros/compression", "tauri-utils/compression" ] wry = [ "tauri-runtime-wry" ] objc-exception = [ "tauri-runtime-wry/objc-exception" ] diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index b23b1ca99..049cabc70 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -31,7 +31,8 @@ //! - **fs-extract-api**: Enabled the `tauri::api::file::Extract` API. //! - **cli**: Enables usage of `clap` for CLI argument parsing. Enabled by default if the `cli` config is defined on the `tauri.conf.json` file. //! - **system-tray**: Enables application system tray API. Enabled by default if the `systemTray` config is defined on the `tauri.conf.json` file. -//! - **ayatana-tray** *(enabled by default)*: Use libayatana-appindicator for system tray on Linux. +//! Note that you must select one of `ayatana-tray` and `gtk-tray` features on Linux. +//! - **ayatana-tray**: Use libayatana-appindicator for system tray on Linux. //! - **gtk-tray**: Use libappindicator3-1 for system tray on Linux. To enable this, you need to disable the default features. //! - **macos-private-api**: Enables features only available in **macOS**'s private APIs, currently the `transparent` window functionality and the `fullScreenEnabled` preference setting to `true`. Enabled by default if the `tauri > macosPrivateApi` config flag is set to `true` on the `tauri.conf.json` file. //! - **window-data-url**: Enables usage of data URLs on the webview. @@ -250,6 +251,10 @@ pub use { #[cfg_attr(doc_cfg, doc(cfg(feature = "clipboard")))] pub use self::runtime::ClipboardManager; +#[cfg(feature = "global-shortcut")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "global-shortcut")))] +pub use self::runtime::GlobalShortcutManager; + /// Updater events. #[cfg(updater)] #[cfg_attr(doc_cfg, doc(cfg(feature = "updater")))] diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 21991012b..35ba43aa0 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -441,12 +441,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "chunked_transfer" version = "1.4.0" @@ -3395,17 +3389,15 @@ dependencies = [ [[package]] name = "tauri" -version = "1.0.0-rc.6" +version = "1.0.0-rc.7" dependencies = [ "anyhow", "attohttpc", "base64", "bincode", "bytes", - "cfg_aliases", "clap", "dirs-next", - "either", "embed_plist", "flate2", "futures", @@ -3413,6 +3405,7 @@ dependencies = [ "glib", "glob", "gtk", + "heck 0.4.0", "http", "ico", "ignore", @@ -3453,7 +3446,7 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.0.0-rc.5" +version = "1.0.0-rc.6" dependencies = [ "anyhow", "cargo_toml", @@ -3465,7 +3458,7 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.0.0-rc.4" +version = "1.0.0-rc.5" dependencies = [ "base64", "brotli", @@ -3485,7 +3478,7 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "1.0.0-rc.4" +version = "1.0.0-rc.5" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -3497,7 +3490,7 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.3.4" +version = "0.4.0" dependencies = [ "gtk", "http", @@ -3514,7 +3507,7 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.3.5" +version = "0.4.0" dependencies = [ "gtk", "rand 0.8.5", @@ -3528,7 +3521,7 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.0.0-rc.4" +version = "1.0.0-rc.5" dependencies = [ "aes-gcm", "brotli", diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index e60b1779c..e4eae7738 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -12,7 +12,7 @@ tauri-build = { path = "../../../core/tauri-build", features = ["isolation"] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = [ "derive" ] } -tauri = { path = "../../../core/tauri", default-features = false, features = ["api-all", "cli", "compression", "http-multipart", "icon-ico", "icon-png", "isolation", "macos-private-api", "objc-exception", "reqwest-client", "system-tray", "updater", "wry"] } +tauri = { path = "../../../core/tauri", features = ["api-all", "cli", "http-multipart", "icon-ico", "icon-png", "isolation", "macos-private-api", "reqwest-client", "system-tray", "updater", "global-shortcut"] } tiny_http = "0.11" [features]