summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-01-16 11:36:07 +0100
committerJens Granseuer <jensgr@gmx.net>2010-01-16 11:36:07 +0100
commit279fee492c149b782130ba5152b6cd433da95669 (patch)
tree6368ee2ce47b498ab9dc4c60ab6f8cc3ed2855ab
parent868060f29a83813859a0642ed7092b9b87d29cad (diff)
downloadgnome-settings-daemon-279fee492c149b782130ba5152b6cd433da95669.tar.gz
Don't die on X servers without XKB
If you use an X server without XKB, gnome-settings-daemon does not survive session startup. The reason is that the modmap implementation of libxklavier returns 0 for max_groups. This makes some of the max_groups - 1 acrobatics in the keyboard plugin go bad, leading to a segfault. Closes bug #604651.
-rw-r--r--plugins/keyboard/gsd-keyboard-xkb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/keyboard/gsd-keyboard-xkb.c b/plugins/keyboard/gsd-keyboard-xkb.c
index a7fb5b5c..ff311495 100644
--- a/plugins/keyboard/gsd-keyboard-xkb.c
+++ b/plugins/keyboard/gsd-keyboard-xkb.c
@@ -588,7 +588,7 @@ apply_xkb_settings (void)
GSList *found_node;
int max_groups;
- max_groups = xkl_engine_get_max_num_groups (xkl_engine);
+ max_groups = MAX (xkl_engine_get_max_num_groups (xkl_engine), 1);
layouts = gconf_client_get_list (conf_client,
GKBD_KEYBOARD_CONFIG_KEY_LAYOUTS,
GCONF_VALUE_STRING, NULL);