92 lines
3.4 KiB
Diff
92 lines
3.4 KiB
Diff
|
From a4c286ad57e53935de67034ea9224069a3ad7472 Mon Sep 17 00:00:00 2001
|
||
|
From: Ray Strode <rstrode@redhat.com>
|
||
|
Date: Sat, 9 Sep 2023 17:07:46 -0400
|
||
|
Subject: [PATCH 06/12] keyboard: Don't require localed for non-system modes
|
||
|
|
||
|
If we're in existing user mode, the user may not have
|
||
|
permission to set the system keymap.
|
||
|
|
||
|
This commit makes sure that lack of permission doesn't
|
||
|
prevent the keyboard page from completing.
|
||
|
---
|
||
|
gnome-initial-setup/pages/keyboard/gis-keyboard-page.c | 9 +++++++--
|
||
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
|
||
|
index ad48d933..d23b72b2 100644
|
||
|
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
|
||
|
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
|
||
|
@@ -396,62 +396,67 @@ preselect_input_source (GisKeyboardPage *self)
|
||
|
* - If we got nothing from gnome-desktop and there's no system-wide
|
||
|
* keyboard layout set, we don't preselect anything.
|
||
|
*
|
||
|
* See:
|
||
|
* - https://bugzilla.gnome.org/show_bug.cgi?id=776189
|
||
|
* - https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/issues/104
|
||
|
*/
|
||
|
language = cc_common_language_get_current_language ();
|
||
|
|
||
|
desktop_got_something = gnome_get_input_source_from_locale (language, &type, &id);
|
||
|
desktop_got_input_method = (desktop_got_something && g_strcmp0 (type, "xkb") != 0);
|
||
|
|
||
|
if (desktop_got_something && (desktop_got_input_method || !priv->system_sources)) {
|
||
|
cc_input_chooser_set_input (CC_INPUT_CHOOSER (priv->input_chooser),
|
||
|
id, type);
|
||
|
} else if (priv->system_sources) {
|
||
|
cc_input_chooser_set_input (CC_INPUT_CHOOSER (priv->input_chooser),
|
||
|
(const gchar *) priv->system_sources->data,
|
||
|
"xkb");
|
||
|
}
|
||
|
|
||
|
g_free (language);
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
update_page_complete (GisKeyboardPage *self)
|
||
|
{
|
||
|
GisKeyboardPagePrivate *priv = gis_keyboard_page_get_instance_private (self);
|
||
|
gboolean complete;
|
||
|
|
||
|
- complete = (priv->localed != NULL &&
|
||
|
- cc_input_chooser_get_input_id (CC_INPUT_CHOOSER (priv->input_chooser)) != NULL);
|
||
|
+ if (gis_driver_get_mode (GIS_PAGE (self)->driver) & GIS_DRIVER_MODE_SYSTEM) {
|
||
|
+ complete = (priv->localed != NULL &&
|
||
|
+ cc_input_chooser_get_input_id (CC_INPUT_CHOOSER (priv->input_chooser)) != NULL);
|
||
|
+ } else {
|
||
|
+ complete = cc_input_chooser_get_input_id (CC_INPUT_CHOOSER (priv->input_chooser)) != NULL;
|
||
|
+ }
|
||
|
+
|
||
|
gis_page_set_complete (GIS_PAGE (self), complete);
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
localed_proxy_ready (GObject *source,
|
||
|
GAsyncResult *res,
|
||
|
gpointer data)
|
||
|
{
|
||
|
GisKeyboardPage *self = data;
|
||
|
GisKeyboardPagePrivate *priv = gis_keyboard_page_get_instance_private (self);
|
||
|
GDBusProxy *proxy;
|
||
|
GError *error = NULL;
|
||
|
|
||
|
proxy = g_dbus_proxy_new_finish (res, &error);
|
||
|
|
||
|
if (!proxy) {
|
||
|
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||
|
g_warning ("Failed to contact localed: %s", error->message);
|
||
|
g_error_free (error);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
priv->localed = proxy;
|
||
|
|
||
|
preselect_input_source (self);
|
||
|
update_page_complete (self);
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
input_confirmed (CcInputChooser *chooser,
|
||
|
--
|
||
|
2.41.0
|
||
|
|