diff --git a/.changes/config.json b/.changes/config.json index c1a0c2180..f121a03be 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -70,7 +70,8 @@ }, "tao": { "path": "./", - "manager": "rust" + "manager": "rust", + "dependencies": ["tao-macros"] } } } diff --git a/.changes/kde-taskbar-progress.md b/.changes/kde-taskbar-progress.md new file mode 100644 index 000000000..a23413a8c --- /dev/null +++ b/.changes/kde-taskbar-progress.md @@ -0,0 +1,5 @@ +--- +"tao": "patch" +--- + +On Linux, removed internal check for current desktop environment before applying `Window::set_progress_bar` API. This should allow `Window::set_progress_bar` to work on KDE Plasma and similar environments that support `libunity` APIs. diff --git a/CHANGELOG.md b/CHANGELOG.md index 5253c3603..b11b2b956 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[0.29.1] + +- [`4cd53415`](https://github.com/tauri-apps/tao/commit/4cd534151a2d7a14ade906f960ec02655a91feae) ([#964](https://github.com/tauri-apps/tao/pull/964) by [@lucasfernog](https://github.com/tauri-apps/tao/../../lucasfernog)) Allow Android domain names to include `_1` as escaped `_` characters - required because `_` is the separator for domain parts. + ## \[0.29.0] - [`e67cf1b2`](https://github.com/tauri-apps/tao/commit/e67cf1b2826d32b8eb58f6d111271a1c42b62978) ([#941](https://github.com/tauri-apps/tao/pull/941) by [@Sanae6](https://github.com/tauri-apps/tao/../../Sanae6)) Prevent duplicate mouse press, release, and motion events from firing on Linux (fixes #939) diff --git a/Cargo.toml b/Cargo.toml index 7c3b926e2..3bdd76772 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tao" -version = "0.29.0" +version = "0.29.1" description = "Cross-platform window manager library." authors = [ "Tauri Programme within The Commons Conservancy", diff --git a/src/platform_impl/linux/taskbar.rs b/src/platform_impl/linux/taskbar.rs index 3bbc919a6..4b951ac34 100644 --- a/src/platform_impl/linux/taskbar.rs +++ b/src/platform_impl/linux/taskbar.rs @@ -18,7 +18,6 @@ pub struct TaskbarIndicator { desktop_filename: Option, desktop_filename_c_str: Option, - is_supported: bool, unity_lib: Option>, attempted_load: bool, @@ -32,7 +31,6 @@ impl TaskbarIndicator { desktop_filename: None, desktop_filename_c_str: None, - is_supported: is_supported(), unity_lib: None, attempted_load: false, @@ -89,10 +87,6 @@ impl TaskbarIndicator { self.desktop_filename = Some(uri); } - if !self.is_supported { - return; - } - self.ensure_lib_load(); if !self.is_unity_running() { @@ -127,12 +121,3 @@ impl TaskbarIndicator { } } } - -pub fn is_supported() -> bool { - std::env::var("XDG_CURRENT_DESKTOP") - .map(|d| { - let d = d.to_lowercase(); - d.contains("unity") || d.contains("gnome") - }) - .unwrap_or(false) -} diff --git a/tao-macros/CHANGELOG.md b/tao-macros/CHANGELOG.md index cf939f2df..2fe0117a3 100644 --- a/tao-macros/CHANGELOG.md +++ b/tao-macros/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[0.1.3] + +- [`4cd53415`](https://github.com/tauri-apps/tao/commit/4cd534151a2d7a14ade906f960ec02655a91feae) ([#964](https://github.com/tauri-apps/tao/pull/964) by [@lucasfernog](https://github.com/tauri-apps/tao/../../lucasfernog)) Allow Android domain names to include `_1` as escaped `_` characters - required because `_` is the separator for domain parts. + ## \[0.1.2] - [`b7758314`](https://github.com/tauri-apps/tao/commit/b7758314abf8c6916c865d9b31eea5bd17b2fe16)([#780](https://github.com/tauri-apps/tao/pull/780)) Added support to lifetime parameters on `android_fn`. diff --git a/tao-macros/Cargo.toml b/tao-macros/Cargo.toml index 5db4f24e7..98f973a14 100644 --- a/tao-macros/Cargo.toml +++ b/tao-macros/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tao-macros" description = "Proc macros for tao" -version = "0.1.2" +version = "0.1.3" edition = "2021" authors = [ "Tauri Programme within The Commons Conservancy" ] rust-version = "1.56" diff --git a/tao-macros/src/lib.rs b/tao-macros/src/lib.rs index b212e26d2..61b46a611 100644 --- a/tao-macros/src/lib.rs +++ b/tao-macros/src/lib.rs @@ -101,7 +101,7 @@ impl Parse for AndroidFnInput { /// 5. List of extra types your Rust function expects. Pass empty array if the function doesn't need any arugments. /// - If your function takes an arguments as reference with a lifetime tied to the [`JNIEnv`], it should use `'local` as the lifetime name as it is the /// lifetime name generated by the macro. -/// Note that all rust functions should expect the first two parameters to be [`JNIEnv`] and [`JClass`] so make sure they are imported into scope). +/// Note that all rust functions should expect the first two parameters to be [`JNIEnv`] and [`JClass`] so make sure they are imported into scope). /// 6. (Optional) Return type of your rust function. /// - If your function returns a reference with a lifetime tied to the [`JNIEnv`], it should use `'local` as the lifetime name as it is the /// lifetime name generated by the macro. @@ -202,7 +202,7 @@ pub fn android_fn(tokens: TokenStream) -> TokenStream { } = tokens; let domain = domain.to_string(); - let package = package.to_string().replace('_', "_1").replace('-', "_1"); + let package = package.to_string().replace('_', "_1"); let class = class.to_string(); let args = args .into_iter() @@ -273,6 +273,11 @@ impl Parse for GeneratePackageNameInput { /// 1. snake_case representation of the reversed domain of the app. /// 2. snake_case representation of the package name. /// +/// Note that `_` is the separator for the domain parts. +/// For instance the `com.tauri.app` identifier should be represented as +/// `generate_package_name!(com_tauri, app)`. +/// To escape the `_` character you can use `_1` which aligns with the default NDK implementation. +/// /// ## Example /// /// ``` @@ -295,8 +300,15 @@ pub fn generate_package_name(tokens: TokenStream) -> TokenStream { let tokens = parse_macro_input!(tokens as GeneratePackageNameInput); let GeneratePackageNameInput { domain, package } = tokens; - let domain = domain.to_string().replace('_', "/"); - let package = package.to_string().replace('-', "_"); + // note that this character is invalid in an identifier so it's safe to use as replacement + const TEMP_ESCAPE_UNDERSCORE_REPLACEMENT: &str = "<"; + + let domain = domain + .to_string() + .replace("_1", TEMP_ESCAPE_UNDERSCORE_REPLACEMENT) + .replace('_', "/") + .replace(TEMP_ESCAPE_UNDERSCORE_REPLACEMENT, "_"); + let package = package.to_string(); let path = format!("{}/{}", domain, package); let litstr = LitStr::new(&path, proc_macro2::Span::call_site());