Skip to content

Commit

Permalink
fix(linux): remove current DE check
Browse files Browse the repository at this point in the history
closes #962
  • Loading branch information
amrbashir committed Aug 26, 2024
1 parent f591636 commit 1240770
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changes/kde-taskbar-progress.md
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 0 additions & 15 deletions src/platform_impl/linux/taskbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -32,7 +31,6 @@ impl TaskbarIndicator {
desktop_filename: None,
desktop_filename_c_str: None,

is_supported: is_supported(),
unity_lib: None,
attempted_load: false,

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
}

0 comments on commit 1240770

Please sign in to comment.