From 57cd0ad1c4e3bea0d4972046080c52b94d368fd7 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Wed, 27 Mar 2024 12:36:52 +0900 Subject: [PATCH] window-list: use DesktopAppInfo to find apps for icons 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. --- src/panel/widgets/window-list/toplevel.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/panel/widgets/window-list/toplevel.cpp b/src/panel/widgets/window-list/toplevel.cpp index 3f6e36e..9bcefdd 100644 --- a/src/panel/widgets/window-list/toplevel.cpp +++ b/src/panel/widgets/window-list/toplevel.cpp @@ -665,11 +665,7 @@ Icon get_from_desktop_app_info(std::string app_id) std::vector 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 app_id_variations = { @@ -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); } } }