summaryrefslogtreecommitdiff
path: root/src/core/iconcache.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2021-05-26 14:14:59 -0400
committerraveit65 <[email protected]>2021-06-04 17:02:28 +0200
commit60e6fbfb093d63c46ca8e77750c54f31c9780c1c (patch)
tree5ef3ac5375f5e306676efb3329758eca6fa4c05d /src/core/iconcache.c
parentf2ca234719034c5ead3c94b8717913b8a4b67773 (diff)
downloadmarco-60e6fbfb093d63c46ca8e77750c54f31c9780c1c.tar.bz2
marco-60e6fbfb093d63c46ca8e77750c54f31c9780c1c.tar.xz
iconcache: Use GDesktopAppInfo to find correct application icons
Some files do not report their application icons correctly in the window properties. This patch allows the marco UI to search for the corresponding .desktop file and render the icon in the desktop info on both the alt-tab popup and the window mini-icon.
Diffstat (limited to 'src/core/iconcache.c')
-rw-r--r--src/core/iconcache.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/core/iconcache.c b/src/core/iconcache.c
index aa1d4339..a45d3d99 100644
--- a/src/core/iconcache.c
+++ b/src/core/iconcache.c
@@ -25,6 +25,7 @@
#include "iconcache.h"
#include "ui.h"
#include "errors.h"
+#include "window-private.h"
#include <X11/Xatom.h>
@@ -690,6 +691,7 @@ scaled_from_pixdata (guchar *pixdata,
gboolean
meta_read_icons (MetaScreen *screen,
Window xwindow,
+ char *res_name,
MetaIconCache *icon_cache,
Pixmap wm_hints_pixmap,
Pixmap wm_hints_mask,
@@ -847,13 +849,20 @@ meta_read_icons (MetaScreen *screen,
{
icon_cache->fallback_icon_dirty_forced = FALSE;
- get_fallback_icons (screen,
- iconp,
- ideal_width,
- ideal_height,
- mini_iconp,
- ideal_mini_width,
- ideal_mini_height);
+ if (res_name != NULL)
+ {
+ *iconp = meta_ui_get_window_icon_from_name (screen->ui, res_name);
+ *mini_iconp = meta_ui_get_mini_icon_from_name (screen->ui, res_name);
+ }
+
+ if (*iconp == NULL || *mini_iconp == NULL)
+ get_fallback_icons (screen,
+ iconp,
+ ideal_width,
+ ideal_height,
+ mini_iconp,
+ ideal_mini_width,
+ ideal_mini_height);
replace_cache (icon_cache, USING_FALLBACK_ICON,
*iconp, *mini_iconp);