Skip to content

Commit

Permalink
refactor(tauri): remove ayatana-tray from the default features (#3976)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Apr 26, 2022
1 parent 7ae9e25 commit 62cdb2b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .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.
5 changes: 5 additions & 0 deletions .changes/expose-global-shortcut.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Re-export the `GlobalShortcutManager` when the `global-shortcut` feature is enabled.
2 changes: 1 addition & 1 deletion .github/workflows/lint-fmt-core.yml
Expand Up @@ -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'
}
- {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-core.yml
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/udeps.yml
Expand Up @@ -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' }
Expand Down
2 changes: 1 addition & 1 deletion core/tauri/Cargo.toml
Expand Up @@ -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" ]
Expand Down
7 changes: 6 additions & 1 deletion core/tauri/src/lib.rs
Expand Up @@ -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.
Expand Down Expand Up @@ -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")))]
Expand Down
23 changes: 8 additions & 15 deletions examples/api/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/api/src-tauri/Cargo.toml
Expand Up @@ -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]
Expand Down

0 comments on commit 62cdb2b

Please sign in to comment.