Skip to content

Commit d297fce

Browse files
authored
fix(desktop-entries): Filter desktop entries by App ID rather than Name
This change also avoids any entry whose Exec is `false`. This fixes the GNOME Extensions app, which has two entries with the same Name, but differing App ID's. One of these should be ignored by the launcher, and has its Exec as `false`.
1 parent bbd513a commit d297fce

File tree

1 file changed

+6
-2
lines changed
  • plugins/src/desktop_entries

1 file changed

+6
-2
lines changed

plugins/src/desktop_entries/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ struct Item {
2525

2626
impl Hash for Item {
2727
fn hash<H: Hasher>(&self, state: &mut H) {
28-
self.name.hash(state);
28+
self.appid.hash(state);
2929
self.src.hash(state);
3030
}
3131
}
3232

3333
impl PartialEq for Item {
3434
fn eq(&self, other: &Self) -> bool {
35-
self.name == other.name && self.src == other.src
35+
self.appid == other.appid && self.src == other.src
3636
}
3737
}
3838

@@ -120,6 +120,10 @@ impl<W: AsyncWrite + Unpin> App<W> {
120120

121121
if let Some((name, exec)) = entry.name(locale).zip(entry.exec()) {
122122
if let Some(exec) = exec.split_ascii_whitespace().next() {
123+
if exec == "false" {
124+
continue;
125+
}
126+
123127
let item = Item {
124128
appid: entry.appid.to_owned(),
125129
name: name.to_string(),

0 commit comments

Comments
 (0)