Skip to content

Commit

Permalink
window-list: use DesktopAppInfo to find apps for icons
Browse files Browse the repository at this point in the history
The icons in the window list are loaded by parsing the .desktop
files for a few variations of the window's app ID in a few known
locations. This doesn't look everywhere it should - for example,
it doesn't look into ~/.local/share/applications or look at
XDG_DATA_DIRS.

Use the standard Gio::DesktopAppInfo::create instead.
  • Loading branch information
lcolitti authored and ammen99 committed Apr 3, 2024
1 parent 7841a49 commit 57cd0ad
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/panel/widgets/window-list/toplevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,7 @@ Icon get_from_desktop_app_info(std::string app_id)

std::vector<std::string> prefixes = {
"",
"/usr/share/applications/",
"/usr/share/applications/kde/",
"/usr/share/applications/org.kde.",
"/usr/local/share/applications/",
"/usr/local/share/applications/org.kde.",
"org.kde.",
};

std::vector<std::string> app_id_variations = {
Expand All @@ -690,8 +686,7 @@ Icon get_from_desktop_app_info(std::string app_id)
{
if (!app_info)
{
app_info = Gio::DesktopAppInfo
::create_from_filename(prefix + id + suffix);
app_info = Gio::DesktopAppInfo::create(prefix + id + suffix);
}
}
}
Expand Down

0 comments on commit 57cd0ad

Please sign in to comment.