Skip to content

Commit

Permalink
fix: compare OnlyShowIn to XDG_CURRENT_DESKTOP
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Jul 30, 2024
1 parent 5323a09 commit d88d0ba
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,17 @@ pub fn menu_control_padding() -> Padding {
impl CosmicAppLibrary {
pub fn load_apps(&mut self) {
let locale = self.locale.as_deref();
let xdg_current_desktop = std::env::var("XDG_CURRENT_DESKTOP").ok();
self.all_entries = cosmic::desktop::load_applications_filtered(locale, |entry| {
entry.exec().is_some() && !entry.no_display()
entry.exec().is_some()
&& !entry.no_display()
&& xdg_current_desktop
.as_ref()
.zip(entry.only_show_in())
.map(|(xdg_current_desktop, only_show_in)| {
only_show_in.contains(xdg_current_desktop)
})
.unwrap_or(true)
})
.into_iter()
.map(Arc::new)
Expand Down

0 comments on commit d88d0ba

Please sign in to comment.