diff options
author | raveit65 <[email protected]> | 2017-04-03 15:47:36 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-04-06 15:14:09 +0200 |
commit | 3611172a4debb5557534f50051bf6fbeebd5c7bf (patch) | |
tree | 0eca2bd4653fb04b80613a5f12651c47e12d9f58 | |
parent | 1772caebba651c63de73c75ccd5eea709eddcd65 (diff) | |
download | libmatekbd-3611172a4debb5557534f50051bf6fbeebd5c7bf.tar.bz2 libmatekbd-3611172a4debb5557534f50051bf6fbeebd5c7bf.tar.xz |
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
-rw-r--r-- | libmatekbd/matekbd-indicator-config.c | 11 |
1 files 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); |