summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-04-03 15:47:36 +0200
committerraveit65 <[email protected]>2017-04-06 15:17:57 +0200
commit303e86ed31a12d44592b3a688d2584a6bd9304ff (patch)
tree4bb0bb143b717c21374d02ae2a3874d116b4c75d
parent4e78638051b25a3fb6ff2ce47ff9a42f711f4982 (diff)
downloadlibmatekbd-303e86ed31a12d44592b3a688d2584a6bd9304ff.tar.bz2
libmatekbd-303e86ed31a12d44592b3a688d2584a6bd9304ff.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.c11
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);