diff options
author | monsta <[email protected]> | 2017-05-25 14:28:39 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-05-25 14:28:39 +0300 |
commit | d3fd7a8f7689adf0b0d4751db15351c8a70dfc6b (patch) | |
tree | e287a4e4161efc2a9e57b81d0f0125000c9ea3d4 | |
parent | 8377fd4db70ccff2026b1978964c91cac9a63ab9 (diff) | |
download | mate-panel-1.16.tar.bz2 mate-panel-1.16.tar.xz |
GTK+3: fix crash when some .desktop file has empty Icon field1.16
port of c57c2c40d5d6b1cfbab1978cba9c785b0d70f888 to mixed GTK+2/3 code
-rw-r--r-- | mate-panel/menu.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mate-panel/menu.c b/mate-panel/menu.c index 053c077b..e2a8d5c9 100644 --- a/mate-panel/menu.c +++ b/mate-panel/menu.c @@ -1212,15 +1212,26 @@ create_menuitem (GtkWidget *menu, if (matemenu_tree_entry_get_icon (entry) != NULL) { const char *icon; +#if GTK_CHECK_VERSION (3, 0, 0) + GIcon *gicon; +#else char *icon_no_ext; +#endif icon = matemenu_tree_entry_get_icon (entry); +#if GTK_CHECK_VERSION (3, 0, 0) + gicon = panel_gicon_from_icon_name (icon); + if (gicon != NULL) { + gtk_drag_source_set_icon_gicon (menuitem, gicon); + } +#else 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); } +#endif } g_signal_connect (G_OBJECT (menuitem), "drag_begin", |