[gnome-settings-daemon] Don't die on X servers without XKB



commit 279fee492c149b782130ba5152b6cd433da95669
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 16 11:36:07 2010 +0100

    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.

 plugins/keyboard/gsd-keyboard-xkb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/keyboard/gsd-keyboard-xkb.c b/plugins/keyboard/gsd-keyboard-xkb.c
index a7fb5b5..ff31149 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);



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