1
0
gnome-settings-daemon/gnome-settings-daemon-gdm-layout-variant.patch

56 lines
1.9 KiB
Diff
Raw Normal View History

commit 3d5189d3984980ec97d794f7bde6159bc97e1379
Author: Martin Pitt <martin.pitt@ubuntu.com>
Date: Mon Oct 19 18:59:07 2009 +0200
fix variant handling in $GDM_KEYBOARD_LAYOUT
gdm's configuration and $GDM_KEYBOARD_LAYOUT separates layout and
variant with a space, but GConf uses tabs. Convert spaces to tabs in
$GDM_KEYBOARD_LAYOUT to work with either format, for more robustness.
https://bugzilla.gnome.org/show_bug.cgi?id=596897
Index: gnome-settings-daemon-2.28.1/plugins/keyboard/gsd-keyboard-xkb.c
===================================================================
--- gnome-settings-daemon-2.28.1.orig/plugins/keyboard/gsd-keyboard-xkb.c
+++ gnome-settings-daemon-2.28.1/plugins/keyboard/gsd-keyboard-xkb.c
@@ -314,7 +314,8 @@ apply_xkb_settings (void)
GConfClient *conf_client;
GkbdKeyboardConfig current_sys_kbd_config;
int group_to_activate = -1;
- const char *gdm_layout;
+ char *gdm_layout;
+ char *s;
if (!inited_ok)
return;
@@ -326,8 +327,18 @@ apply_xkb_settings (void)
* We clear gdm_keyboard_layout early, so we don't risk
* recursion from gconf notification.
*/
- gdm_layout = gdm_keyboard_layout;
+ gdm_layout = g_strdup (gdm_keyboard_layout);
gdm_keyboard_layout = NULL;
+
+ /* gdm's configuration and $GDM_KEYBOARD_LAYOUT separates layout and
+ * variant with a space, but gconf uses tabs; so convert to be robust
+ * with both */
+ for (s = gdm_layout; s && *s; ++s) {
+ if (*s == ' ') {
+ *s = '\t';
+ }
+ }
+
if (gdm_layout != NULL) {
GSList *layouts;
GSList *found_node;
@@ -383,6 +394,8 @@ apply_xkb_settings (void)
gkbd_keyboard_config_load_from_x_current (&current_sys_kbd_config,
NULL);
+ g_free (gdm_layout);
+
if (!try_activating_xkb_config_if_new (&current_sys_kbd_config)) {
if (filter_xkb_config ()) {
if (!try_activating_xkb_config_if_new (&current_sys_kbd_config)) {