diff options
author | monsta <[email protected]> | 2017-05-23 18:34:55 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-05-23 18:34:55 +0300 |
commit | 9b2ce3f4376659a7082287eab07032681be65e77 (patch) | |
tree | 6eaac0a1a1bfa2e6a0347f001acdc50cc364d7f9 | |
parent | 30a6f5facd7bdb45aaeb77a51ea77f2a7f3504ba (diff) | |
download | mate-panel-9b2ce3f4376659a7082287eab07032681be65e77.tar.bz2 mate-panel-9b2ce3f4376659a7082287eab07032681be65e77.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.c | 10 |
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); } } |