[gnome-settings-daemon/gnome-3-8] keyboard: Without settings or under GDM make sure to add the US layout
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-8] keyboard: Without settings or under GDM make sure to add the US layout
- Date: Thu, 11 Apr 2013 08:44:55 +0000 (UTC)
commit f1f8384d00a23eb649b64e0ac50b444ab49ad5bf
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Apr 9 02:40:55 2013 +0200
keyboard: Without settings or under GDM make sure to add the US layout
We don't want to end in a situation where users can't login because
they can't type ASCII for their password.
https://bugzilla.gnome.org/show_bug.cgi?id=697597
plugins/keyboard/gsd-keyboard-manager.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c
index cb43f15..c7af673 100644
--- a/plugins/keyboard/gsd-keyboard-manager.c
+++ b/plugins/keyboard/gsd-keyboard-manager.c
@@ -91,6 +91,7 @@
#define INPUT_SOURCE_TYPE_IBUS "ibus"
#define DEFAULT_LANGUAGE "en_US"
+#define DEFAULT_LAYOUT "us"
struct GsdKeyboardManagerPrivate
{
@@ -1270,6 +1271,7 @@ get_sources_from_xkb_config (GsdKeyboardManager *manager)
gint i, n;
gchar **layouts = NULL;
gchar **variants = NULL;
+ gboolean have_default_layout = FALSE;
v = g_dbus_proxy_get_cached_property (priv->localed, "X11Layout");
if (v) {
@@ -1305,9 +1307,16 @@ get_sources_from_xkb_config (GsdKeyboardManager *manager)
else
id = g_strdup (layouts[i]);
+ if (g_str_equal (id, DEFAULT_LAYOUT))
+ have_default_layout = TRUE;
+
g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_XKB, id);
g_free (id);
}
+
+ if (!have_default_layout)
+ g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_XKB, DEFAULT_LAYOUT);
+
g_settings_set_value (priv->input_sources_settings, KEY_INPUT_SOURCES, g_variant_builder_end
(&builder));
g_strfreev (layouts);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]