fix keyboard selection even more

This commit is contained in:
Matthias Clasen 2008-10-11 02:38:01 +00:00
parent c2a24c59c8
commit 7a3cc606cc
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,33 @@
diff -up gnome-settings-daemon-2.24.0/plugins/keyboard/gsd-keyboard-xkb.c.fix-gdm-layout-even-more gnome-settings-daemon-2.24.0/plugins/keyboard/gsd-keyboard-xkb.c
--- gnome-settings-daemon-2.24.0/plugins/keyboard/gsd-keyboard-xkb.c.fix-gdm-layout-even-more 2008-10-10 21:52:55.000000000 -0400
+++ gnome-settings-daemon-2.24.0/plugins/keyboard/gsd-keyboard-xkb.c 2008-10-10 22:25:28.000000000 -0400
@@ -162,14 +162,27 @@ apply_xkb_settings (void)
/* With GDM the user can already set a layout from the login
* screen. Try to keep that setting */
if (gdm_keyboard_layout != NULL) {
+ /* if there is just a single layout,
+ * just override it (it is probably the X server default)
+ */
+ if (current_kbd_config.layouts_variants &&
+ current_kbd_config.layouts_variants->next == NULL) {
+ g_free (current_kbd_config.layouts_variants->data);
+ g_slist_free (current_kbd_config.layouts_variants);
+ current_kbd_config.layouts_variants = NULL;
+ }
if (current_kbd_config.layouts_variants == NULL) {
- current_kbd_config.layouts_variants = g_slist_append (NULL, (char *) gdm_keyboard_layout);
+ current_kbd_config.layouts_variants = g_slist_append (NULL, g_strdup (gdm_keyboard_layout));
gconf_client_set_list (conf_client,
GKBD_KEYBOARD_CONFIG_KEY_LAYOUTS,
GCONF_VALUE_STRING,
current_kbd_config.layouts_variants,
NULL);
- } else {
+ }
+ else {
+ /* if there are multiple layouts,
+ * try to find the one closest to the gdm layout
+ */
GSList *l;
int i;
size_t len = strlen (gdm_keyboard_layout);

View File

@ -1,6 +1,6 @@
Name: gnome-settings-daemon
Version: 2.24.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
Group: System Environment/Daemons
@ -41,6 +41,9 @@ Patch8: gnome-settings-daemon-2.23.92-fade.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=554525
Patch9: fix-gdm-layout.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=555873
Patch10: fix-gdm-layout-even-more.patch
%description
A daemon to share settings from GNOME to other applications. It also
handles global keybindings, as well as a number of desktop-wide settings.
@ -64,6 +67,7 @@ developing applications that use %{name}.
%patch7 -p1 -b .fnf7-cycle
%patch8 -p1 -b .fade
%patch9 -p1 -b .fix-gdm-layout
%patch10 -p1 -b .fix-gdm-layout-even-more
%build
aclocal
@ -163,6 +167,9 @@ fi
%{_libdir}/pkgconfig/gnome-settings-daemon.pc
%changelog
* Fri Oct 10 2008 Matthias Clasen <mclasen@redhat.com> - 2.24.0-4
- Fix the picking up of the gdm keyboard layout even more
* Tue Sep 30 2008 Matthias Clasen <mclasen@redhat.com> - 2.24.0-3
- Fix the picking up of the gdm keyboard layout