summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-05-23 18:34:55 +0300
committerraveit65 <[email protected]>2017-05-24 19:31:04 +0200
commitc57c2c40d5d6b1cfbab1978cba9c785b0d70f888 (patch)
tree711ffc9610974ef21814c4a122d883e90d9a907e
parentd0ffc53f1202accf116fb777d66f24058e7d38b6 (diff)
downloadmate-panel-c57c2c40d5d6b1cfbab1978cba9c785b0d70f888.tar.bz2
mate-panel-c57c2c40d5d6b1cfbab1978cba9c785b0d70f888.tar.xz
menu: fix crash when some .desktop file has empty Icon field
fixes https://github.com/mate-desktop/mate-panel/issues/494
-rw-r--r--mate-panel/menu.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mate-panel/menu.c b/mate-panel/menu.c
index fd2cccbd..05cba577 100644
--- a/mate-panel/menu.c
+++ b/mate-panel/menu.c
@@ -1177,14 +1177,12 @@ create_menuitem (GtkWidget *menu,
if (matemenu_tree_entry_get_icon (entry) != NULL) {
const char *icon;
- char *icon_no_ext;
+ GIcon *gicon;
icon = matemenu_tree_entry_get_icon (entry);
- if (!g_path_is_absolute (icon)) {
- icon_no_ext = panel_xdg_icon_remove_extension (icon);
- gtk_drag_source_set_icon_name (menuitem,
- icon_no_ext);
- g_free (icon_no_ext);
+ gicon = panel_gicon_from_icon_name (icon);
+ if (gicon != NULL) {
+ gtk_drag_source_set_icon_gicon (menuitem, gicon);
}
}