From 82bbd34eeb78fc5eba147606c157a6debdc36fdf Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Oct 20 2008 16:16:24 +0000 Subject: respect system keyboard setting --- diff --git a/gdm-system-keyboard.patch b/gdm-system-keyboard.patch new file mode 100644 index 0000000..8c6ec0f --- /dev/null +++ b/gdm-system-keyboard.patch @@ -0,0 +1,73 @@ +--- gdm-2.24.0/daemon/gdm-session-direct.c 2008-08-21 00:31:47.000000000 -0400 ++++ hacked/daemon/gdm-session-direct.c 2008-10-20 00:20:05.000000000 -0400 +@@ -595,14 +595,41 @@ + return setlocale (LC_MESSAGES, NULL); + } + ++static char * ++get_system_default_layout (void) ++{ ++ gchar *text, *p, *q; ++ gsize *length; ++ char *result; ++ ++ result = NULL; ++ if (g_file_get_contents ("/etc/sysconfig/keyboard", &text, &length, NULL)) { ++ p = strstr (text, "KEYTABLE=\""); ++ if (p) { ++ p += strlen ("KEYTABLE=\""); ++ q = strchr (p, '"'); ++ if (q) { ++ result = g_strndup (p, q - p); ++ } ++ } ++ g_free (text); ++ } ++ ++ if (!result) { ++ result = g_strdup ("us"); ++ } ++ ++ return result; ++} ++ + static const char * + get_default_layout_name (GdmSessionDirect *session) + { +- if (session->priv->saved_layout != NULL) { +- return session->priv->saved_layout; ++ if (!session->priv->saved_layout) { ++ session->priv->saved_layout = get_system_default_layout (); + } + +- return "us"; ++ return session->priv->saved_layout; + } + + static char * +@@ -1971,9 +1998,10 @@ + "GDM_LANG", + get_language_name (session)); + +- gdm_session_direct_set_environment_variable (session, +- "GDM_KEYBOARD_LAYOUT", +- get_layout_name (session)); ++ if (g_strcmp0 (get_layout_name (session), get_system_default_layout ()) != 0) ++ gdm_session_direct_set_environment_variable (session, ++ "GDM_KEYBOARD_LAYOUT", ++ get_layout_name (session)); + + gdm_session_direct_set_environment_variable (session, + "DISPLAY", +--- gdm-2.24.0/daemon/gdm-session-settings.c 2008-07-10 11:07:42.000000000 -0400 ++++ hacked/daemon/gdm-session-settings.c 2008-10-19 23:55:02.000000000 -0400 +@@ -149,8 +149,7 @@ + { + g_return_if_fail (GDM_IS_SESSION_SETTINGS (settings)); + +- if (settings->priv->layout_name == NULL || +- strcmp (settings->priv->layout_name, layout_name) != 0) { ++ if (g_strcmp0 (settings->priv->layout_name, layout_name) != 0) { + settings->priv->layout_name = g_strdup (layout_name); + g_object_notify (G_OBJECT (settings), "layout-name"); + } diff --git a/gdm.spec b/gdm.spec index e377014..2c8a892 100644 --- a/gdm.spec +++ b/gdm.spec @@ -16,7 +16,7 @@ Summary: The GNOME Display Manager Name: gdm Version: 2.24.0 -Release: 10%{?dist} +Release: 11%{?dist} Epoch: 1 License: GPLv2+ Group: User Interface/X @@ -100,6 +100,10 @@ Patch11: gdm-2.24.0-add-panel-slide.patch # https://bugzilla.redhat.com/show_bug.cgi?id=465121 Patch12: gdm-user-switcher-no-help.patch +# uses /etc/sysconfig/keyboard and is thus not directly upstreamable +# should probably be changed to get the system layout from the X server +Patch13: gdm-system-keyboard.patch + # Fedora-specific Patch99: gdm-2.23.1-fedora-logo.patch @@ -132,6 +136,7 @@ multiple simulanteous logged in users. %patch10 -p1 -b .fix-icon-scale %patch11 -p1 -b .add-panel-slide %patch12 -p1 -b .no-help +%patch13 -p1 -b .system-keyboard %patch99 -p1 -b .fedora-logo @@ -347,6 +352,9 @@ fi %{_datadir}/gnome-2.0/ui/GNOME_FastUserSwitchApplet.xml %changelog +* Mon Oct 20 2008 Matthias Clasen - 1:2.24.0-11 +- Respect system keyboard setting + * Wed Oct 15 2008 Ray Strode - 1:2.24.0-10 - Rework "force X on vt1" code to work after the user logs out