fix(linux): remove current DE check (#967)

closes #962
This commit is contained in:
Amr Bashir
2024-08-27 02:30:04 +03:00
committed by GitHub
parent f591636124
commit e47d4c4aa0
2 changed files with 5 additions and 15 deletions

View File

@@ -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.

View File

@@ -18,7 +18,6 @@ pub struct TaskbarIndicator {
desktop_filename: Option<String>,
desktop_filename_c_str: Option<CString>,
is_supported: bool,
unity_lib: Option<Container<UnityLib>>,
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)
}