From 860a1cec9214fe915d6341eb130c94b6d29287e0 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Tue, 8 Sep 2009 11:00:25 -0400 Subject: [PATCH] Show correct default layout When 'Reset to Defaults' is pressed, the default layout should also be reset. When showing the list of layouts, treat a -1 (unset) default layout value as 0. --- capplets/keyboard/gnome-keyboard-properties-xkb.c | 4 ++++ capplets/keyboard/gnome-keyboard-properties-xkblt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/capplets/keyboard/gnome-keyboard-properties-xkb.c b/capplets/keyboard/gnome-keyboard-properties-xkb.c index f7a7515ad..ba3165988 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkb.c +++ b/capplets/keyboard/gnome-keyboard-properties-xkb.c @@ -134,6 +134,10 @@ reset_to_defaults (GtkWidget * button, GtkBuilder * dialog) gkbd_keyboard_config_save_to_gconf (&empty_kbd_config); gkbd_keyboard_config_term (&empty_kbd_config); + gconf_client_unset (xkb_gconf_client, + GKBD_DESKTOP_CONFIG_KEY_DEFAULT_GROUP, + NULL); + /* all the rest is g-s-d's business */ } diff --git a/capplets/keyboard/gnome-keyboard-properties-xkblt.c b/capplets/keyboard/gnome-keyboard-properties-xkblt.c index 680f0ad83..21b72f8bf 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkblt.c +++ b/capplets/keyboard/gnome-keyboard-properties-xkblt.c @@ -154,7 +154,7 @@ def_group_in_gconf_changed (GConfClient * client, (GTK_TREE_VIEW (tree_view))); GtkTreeIter iter; int counter = 0; - default_group = gconf_value_get_int (value); + default_group = MAX(0, gconf_value_get_int (value)); if (gtk_tree_model_get_iter_first (model, &iter)) { do { gboolean cur_val;