[libgnomekbd] Do not crash on kbd plug in



commit 5298205b5f450e43ffec91ff81be448c0c42d026
Author: Sergey V. Udaltsov <svu gnome org>
Date:   Wed May 5 00:36:04 2010 +0100

    Do not crash on kbd plug in
    
    There is funny race condition in X - when _XKB_RULES_NAMES is already
    loaded from sysconfig while actual XKB config is still not changed (from
    user config). This commit should fix
    https://bugzilla.gnome.org/show_bug.cgi?id=617643

 libgnomekbd/gkbd-indicator.c |    4 ++--
 libgnomekbd/gkbd-status.c    |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libgnomekbd/gkbd-indicator.c b/libgnomekbd/gkbd-indicator.c
index 5def369..f6064fa 100644
--- a/libgnomekbd/gkbd-indicator.c
+++ b/libgnomekbd/gkbd-indicator.c
@@ -318,7 +318,7 @@ gkbd_indicator_extract_layout_name (int group, XklEngine * engine,
 				    gchar ** short_group_names,
 				    gchar ** full_group_names)
 {
-	char *layout_name;
+	char *layout_name = NULL;
 	if (group < g_strv_length (short_group_names)) {
 		if (xkl_engine_get_features (engine) &
 		    XKLF_MULTIPLE_LAYOUTS_SUPPORTED) {
@@ -352,7 +352,7 @@ gkbd_indicator_extract_layout_name (int group, XklEngine * engine,
 	}
 
 	if (layout_name == NULL)
-		layout_name = g_strdup ("??");
+		layout_name = g_strdup ("");
 
 	return layout_name;
 }
diff --git a/libgnomekbd/gkbd-status.c b/libgnomekbd/gkbd-status.c
index dbe65ee..5e62ae9 100644
--- a/libgnomekbd/gkbd-status.c
+++ b/libgnomekbd/gkbd-status.c
@@ -152,6 +152,7 @@ gkbd_status_render_cairo (cairo_t * cr, int group)
 	cairo_font_options_t *fo;
 	static GHashTable *ln2cnt_map = NULL;
 
+	xkl_debug (160, "Rendering cairo for group %d\n", group);
 	if (globals.ind_cfg.background_color != NULL &&
 	    globals.ind_cfg.background_color[0] != 0) {
 		if (sscanf



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]