From 1240770b26a3848875323b2c747f820acee71800 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Tue, 27 Aug 2024 02:18:34 +0300 Subject: [PATCH] fix(linux): remove current DE check closes #962 --- .changes/kde-taskbar-progress.md | 5 +++++ src/platform_impl/linux/taskbar.rs | 15 --------------- 2 files changed, 5 insertions(+), 15 deletions(-) create mode 100644 .changes/kde-taskbar-progress.md 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/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) -}