2016-08-12 11:42:58 +02:00
|
|
|
From c2e0c03c03f47da9b117db0ba876732e84dcf0c4 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Federico Mena Quintero <federico@gnome.org>
|
|
|
|
Date: Mon, 16 May 2016 19:18:43 -0500
|
|
|
|
Subject: [PATCH] Resurrect the code from upstream to set the default keyboard
|
|
|
|
from XKB if there is one.
|
|
|
|
|
|
|
|
Suse works differently than GNOME here; we set a default keyboard from
|
|
|
|
the system's configuration instead of letting GNOME take care of
|
|
|
|
everything itself.
|
|
|
|
|
|
|
|
https://bugzilla.suse.com/show_bug.cgi?id=979051
|
|
|
|
---
|
|
|
|
plugins/keyboard/gsd-keyboard-manager.c | 18 +++++++++++++-----
|
|
|
|
1 file changed, 13 insertions(+), 5 deletions(-)
|
|
|
|
|
2023-09-12 10:20:52 +02:00
|
|
|
Index: b/plugins/keyboard/gsd-keyboard-manager.c
|
|
|
|
===================================================================
|
|
|
|
--- a/plugins/keyboard/gsd-keyboard-manager.c
|
|
|
|
+++ b/plugins/keyboard/gsd-keyboard-manager.c
|
|
|
|
@@ -207,7 +207,7 @@ settings_changed (GSettings *se
|
2016-08-12 11:42:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
-get_sources_from_xkb_config (GsdKeyboardManager *manager)
|
|
|
|
+get_sources_from_xkb_config (GsdKeyboardManager *manager, gboolean running_under_gdm)
|
|
|
|
{
|
|
|
|
GVariantBuilder builder;
|
2019-10-04 17:46:22 +02:00
|
|
|
GVariant *v;
|
2023-09-12 10:20:52 +02:00
|
|
|
@@ -225,7 +225,7 @@ get_sources_from_xkb_config (GsdKeyboard
|
2016-08-12 11:42:58 +02:00
|
|
|
|
2019-10-04 17:46:22 +02:00
|
|
|
init_builder_with_sources (&builder, manager->input_sources_settings);
|
2016-08-12 11:42:58 +02:00
|
|
|
|
2017-08-05 13:50:54 +02:00
|
|
|
- if (!layouts) {
|
|
|
|
+ if (!layouts && running_under_gdm) {
|
|
|
|
g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_XKB, DEFAULT_LAYOUT);
|
|
|
|
goto out;
|
|
|
|
}
|
2023-09-12 10:20:52 +02:00
|
|
|
@@ -404,15 +404,23 @@ maybe_create_initial_settings (GsdKeyboa
|
2016-08-12 11:42:58 +02:00
|
|
|
|
2019-10-04 17:46:22 +02:00
|
|
|
settings = manager->input_sources_settings;
|
2016-08-12 11:42:58 +02:00
|
|
|
|
|
|
|
- if (g_getenv ("RUNNING_UNDER_GDM"))
|
|
|
|
- return;
|
|
|
|
+ if (g_getenv ("RUNNING_UNDER_GDM")) {
|
|
|
|
+ GVariantBuilder builder;
|
|
|
|
+ /* clean the settings and get them from the "system" */
|
|
|
|
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ss)"));
|
|
|
|
+ g_settings_set_value (settings, KEY_INPUT_SOURCES, g_variant_builder_end (&builder));
|
|
|
|
+ get_sources_from_xkb_config (manager, TRUE);
|
|
|
|
+
|
|
|
|
+ g_settings_set_strv (settings, KEY_KEYBOARD_OPTIONS, NULL);
|
|
|
|
+ get_options_from_xkb_config (manager);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
maybe_convert_old_settings (settings);
|
|
|
|
|
|
|
|
/* if we still don't have anything do some educated guesses */
|
|
|
|
sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
|
|
|
|
if (g_variant_n_children (sources) < 1)
|
|
|
|
- get_sources_from_xkb_config (manager);
|
|
|
|
+ get_sources_from_xkb_config (manager, FALSE);
|
|
|
|
g_variant_unref (sources);
|
|
|
|
|
|
|
|
options = g_settings_get_strv (settings, KEY_KEYBOARD_OPTIONS);
|