Fix handling of keyboard layout variants

This commit is contained in:
Matthias Clasen 2009-10-01 14:17:43 +00:00
parent e4dae40c27
commit 3f1c582998
2 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,58 @@
From 19a0f24ad0a819c462595dd59846d0c78a4f75d6 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Thu, 1 Oct 2009 10:49:48 +0200
Subject: [PATCH] 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
---
plugins/keyboard/gsd-keyboard-xkb.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/plugins/keyboard/gsd-keyboard-xkb.c b/plugins/keyboard/gsd-keyboard-xkb.c
index 60495dc..9aa59c0 100644
--- a/plugins/keyboard/gsd-keyboard-xkb.c
+++ b/plugins/keyboard/gsd-keyboard-xkb.c
@@ -217,7 +217,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;
@@ -229,8 +230,16 @@ 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;
layouts = gconf_client_get_list (conf_client,
@@ -276,6 +285,8 @@ apply_xkb_settings (void)
}
}
+ 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)) {
--
1.6.3.3

View File

@ -1,6 +1,6 @@
Name: gnome-settings-daemon
Version: 2.28.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
Group: System Environment/Daemons
@ -35,6 +35,8 @@ BuildRequires: libcanberra-devel
# https://bugzilla.gnome.org/show_bug.cgi?id=596136
Patch0: osd-rounded-rectangle.patch
Patch1: osd-visual-refresh.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=596897
Patch2: fix-variant-handling.patch
%description
A daemon to share settings from GNOME to other applications. It also
@ -55,6 +57,7 @@ developing applications that use %{name}.
%setup -q
%patch0 -p1 -b .osd-rounded-rectangle
%patch1 -p1 -b .osd-visual-refresh
%patch2 -p1 -b .fix-variant-handling
%build
%configure --enable-static=no --enable-profiling --disable-esd
@ -166,6 +169,9 @@ fi
%{_libdir}/pkgconfig/gnome-settings-daemon.pc
%changelog
* Thu Oct 1 2009 Matthias Clasen <mclasen@redhat.com> - 2.28.0-4
- Fix keyboard variant handling
* Fri Sep 25 2009 Matthias Clasen <mclasen@redhat.com> - 2.28.0-3
- Align the OSD visuals with the notification theme