From 3611172a4debb5557534f50051bf6fbeebd5c7bf Mon Sep 17 00:00:00 2001 From: raveit65 Date: Mon, 3 Apr 2017 15:47:36 +0200 Subject: Fix for strange GtkIconInfo behaviour Sometimes you can get an icon without filename. Odd taken from: https://git.gnome.org/browse/libgnomekbd/commit/?id=44e2396 --- libmatekbd/matekbd-indicator-config.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libmatekbd/matekbd-indicator-config.c b/libmatekbd/matekbd-indicator-config.c index bd2066d..804762a 100644 --- a/libmatekbd/matekbd-indicator-config.c +++ b/libmatekbd/matekbd-indicator-config.c @@ -139,7 +139,7 @@ matekbd_indicator_config_refresh_style (MatekbdIndicatorConfig * ind_config) matekbd_indicator_config_load_colors (ind_config); } -char * +gchar * matekbd_indicator_config_get_images_file (MatekbdIndicatorConfig * ind_config, MatekbdKeyboardConfig * @@ -164,6 +164,13 @@ matekbd_indicator_config_get_images_file (MatekbdIndicatorConfig * /* probably there is something in theme? */ icon_info = gtk_icon_theme_lookup_icon (ind_config->icon_theme, l, 48, 0); + + /* Unbelievable but happens */ + if (icon_info != NULL && + gtk_icon_info_get_filename (icon_info) == NULL) { + g_object_unref (icon_info); + icon_info = NULL; + } } } } @@ -195,7 +202,7 @@ matekbd_indicator_config_load_image_filenames (MatekbdIndicatorConfig * for (i = xkl_engine_get_max_num_groups (ind_config->engine); --i >= 0;) { - char *image_file = + gchar *image_file = matekbd_indicator_config_get_images_file (ind_config, kbd_config, i); -- cgit v1.2.1