From 6647e8b626a418d8a31f868694f79fd0f0475184 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 27 Sep 2022 06:46:08 -0400 Subject: [PATCH] import gnome-settings-daemon-40.0.1-8.el9 --- SOURCES/im-module-setting-fix.patch | 561 +++++++++++++++++++++ SOURCES/subscription-manager-support.patch | 189 ++++--- SPECS/gnome-settings-daemon.spec | 11 +- 3 files changed, 684 insertions(+), 77 deletions(-) create mode 100644 SOURCES/im-module-setting-fix.patch diff --git a/SOURCES/im-module-setting-fix.patch b/SOURCES/im-module-setting-fix.patch new file mode 100644 index 0000000..6673c25 --- /dev/null +++ b/SOURCES/im-module-setting-fix.patch @@ -0,0 +1,561 @@ +From 6ab152961de63dec953981aea24a7f0b4e7949ec Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Fri, 3 Dec 2021 23:38:50 +0100 +Subject: [PATCH 1/3] xsettings: Adopt code to look up GTK IM module + +Right now, gsd-keyboard and gsd-xsettings have a strange relation +where the first sets the gtk-im-module dconf setting for the latter +to read the setting and forward it through XSettings. + +Since this detection is highly X11 specific, make it happen in the +Xsettings daemon itself, from the relevant setting and device presence. + +This makes users still able to shoot themselves in the foot by changing +the setting, X11 clients able to be told to switch to ibus if it turns +out necessary, and Wayland clients unaffected otherwise. + +Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/4443 +--- + plugins/keyboard/gsd-keyboard-manager.c | 147 --------------------- + plugins/xsettings/gsd-xsettings-manager.c | 153 ++++++++++++++++++++++ + 2 files changed, 153 insertions(+), 147 deletions(-) + +diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c +index cb4ea98b..d41393bc 100644 +--- a/plugins/keyboard/gsd-keyboard-manager.c ++++ b/plugins/keyboard/gsd-keyboard-manager.c +@@ -57,10 +57,6 @@ + + #define GNOME_DESKTOP_INTERFACE_DIR "org.gnome.desktop.interface" + +-#define KEY_GTK_IM_MODULE "gtk-im-module" +-#define GTK_IM_MODULE_SIMPLE "gtk-im-context-simple" +-#define GTK_IM_MODULE_IBUS "ibus" +- + #define GNOME_DESKTOP_INPUT_SOURCES_DIR "org.gnome.desktop.input-sources" + + #define KEY_INPUT_SOURCES "sources" +@@ -71,9 +67,6 @@ + + #define DEFAULT_LAYOUT "us" + +-#define GNOME_A11Y_APPLICATIONS_INTERFACE_DIR "org.gnome.desktop.a11y.applications" +-#define KEY_OSK_ENABLED "screen-keyboard-enabled" +- + struct _GsdKeyboardManager + { + GObject parent; +@@ -81,21 +74,14 @@ struct _GsdKeyboardManager + guint start_idle_id; + GSettings *settings; + GSettings *input_sources_settings; +- GSettings *a11y_settings; + GDBusProxy *localed; + GCancellable *cancellable; +- +- GdkDeviceManager *device_manager; +- guint device_added_id; +- guint device_removed_id; + }; + + static void gsd_keyboard_manager_class_init (GsdKeyboardManagerClass *klass); + static void gsd_keyboard_manager_init (GsdKeyboardManager *keyboard_manager); + static void gsd_keyboard_manager_finalize (GObject *object); + +-static void update_gtk_im_module (GsdKeyboardManager *manager); +- + G_DEFINE_TYPE (GsdKeyboardManager, gsd_keyboard_manager, G_TYPE_OBJECT) + + static gpointer manager_object = NULL; +@@ -218,121 +204,6 @@ settings_changed (GSettings *settings, + + } + +-static void +-device_added_cb (GdkDeviceManager *device_manager, +- GdkDevice *device, +- GsdKeyboardManager *manager) +-{ +- GdkInputSource source; +- +- source = gdk_device_get_source (device); +- if (source == GDK_SOURCE_TOUCHSCREEN) { +- update_gtk_im_module (manager); +- } +-} +- +-static void +-device_removed_cb (GdkDeviceManager *device_manager, +- GdkDevice *device, +- GsdKeyboardManager *manager) +-{ +- GdkInputSource source; +- +- source = gdk_device_get_source (device); +- if (source == GDK_SOURCE_TOUCHSCREEN) +- update_gtk_im_module (manager); +-} +- +-static void +-set_devicepresence_handler (GsdKeyboardManager *manager) +-{ +- GdkDeviceManager *device_manager; +- +- if (gnome_settings_is_wayland ()) +- return; +- +- device_manager = gdk_display_get_device_manager (gdk_display_get_default ()); +- +- manager->device_added_id = g_signal_connect (G_OBJECT (device_manager), "device-added", +- G_CALLBACK (device_added_cb), manager); +- manager->device_removed_id = g_signal_connect (G_OBJECT (device_manager), "device-removed", +- G_CALLBACK (device_removed_cb), manager); +- manager->device_manager = device_manager; +-} +- +-static gboolean +-need_ibus (GVariant *sources) +-{ +- GVariantIter iter; +- const gchar *type; +- +- g_variant_iter_init (&iter, sources); +- while (g_variant_iter_next (&iter, "(&s&s)", &type, NULL)) +- if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS)) +- return TRUE; +- +- return FALSE; +-} +- +-static gboolean +-need_osk (GsdKeyboardManager *manager) +-{ +- gboolean has_touchscreen = FALSE; +- GList *devices; +- GdkSeat *seat; +- +- if (g_settings_get_boolean (manager->a11y_settings, +- KEY_OSK_ENABLED)) +- return TRUE; +- +- seat = gdk_display_get_default_seat (gdk_display_get_default ()); +- devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_TOUCH); +- +- has_touchscreen = devices != NULL; +- +- g_list_free (devices); +- +- return has_touchscreen; +-} +- +-static void +-set_gtk_im_module (GsdKeyboardManager *manager, +- GSettings *settings, +- GVariant *sources) +-{ +- const gchar *new_module; +- gchar *current_module; +- +- if (need_ibus (sources) || need_osk (manager)) +- new_module = GTK_IM_MODULE_IBUS; +- else +- new_module = GTK_IM_MODULE_SIMPLE; +- +- current_module = g_settings_get_string (settings, KEY_GTK_IM_MODULE); +- if (!g_str_equal (current_module, new_module)) +- g_settings_set_string (settings, KEY_GTK_IM_MODULE, new_module); +- g_free (current_module); +-} +- +-static void +-update_gtk_im_module (GsdKeyboardManager *manager) +-{ +- GSettings *interface_settings; +- GVariant *sources; +- +- /* Gtk+ uses the IM module advertised in XSETTINGS so, if we +- * have IBus input sources, we want it to load that +- * module. Otherwise we can use the default "simple" module +- * which is builtin gtk+ +- */ +- interface_settings = g_settings_new (GNOME_DESKTOP_INTERFACE_DIR); +- sources = g_settings_get_value (manager->input_sources_settings, +- KEY_INPUT_SOURCES); +- set_gtk_im_module (manager, interface_settings, sources); +- g_object_unref (interface_settings); +- g_variant_unref (sources); +-} +- + static void + get_sources_from_xkb_config (GsdKeyboardManager *manager) + { +@@ -580,18 +451,7 @@ start_keyboard_idle_cb (GsdKeyboardManager *manager) + + manager->settings = g_settings_new (GSD_KEYBOARD_DIR); + +- set_devicepresence_handler (manager); +- + manager->input_sources_settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR); +- g_signal_connect_swapped (manager->input_sources_settings, +- "changed::" KEY_INPUT_SOURCES, +- G_CALLBACK (update_gtk_im_module), manager); +- +- manager->a11y_settings = g_settings_new (GNOME_A11Y_APPLICATIONS_INTERFACE_DIR); +- g_signal_connect_swapped (manager->a11y_settings, +- "changed::" KEY_OSK_ENABLED, +- G_CALLBACK (update_gtk_im_module), manager); +- update_gtk_im_module (manager); + + manager->cancellable = g_cancellable_new (); + +@@ -645,14 +505,7 @@ gsd_keyboard_manager_stop (GsdKeyboardManager *manager) + + g_clear_object (&manager->settings); + g_clear_object (&manager->input_sources_settings); +- g_clear_object (&manager->a11y_settings); + g_clear_object (&manager->localed); +- +- if (manager->device_manager != NULL) { +- g_signal_handler_disconnect (manager->device_manager, manager->device_added_id); +- g_signal_handler_disconnect (manager->device_manager, manager->device_removed_id); +- manager->device_manager = NULL; +- } + } + + static void +diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c +index 5f1b4583..1aa020db 100644 +--- a/plugins/xsettings/gsd-xsettings-manager.c ++++ b/plugins/xsettings/gsd-xsettings-manager.c +@@ -56,6 +56,9 @@ + #define PRIVACY_SETTINGS_SCHEMA "org.gnome.desktop.privacy" + #define WM_SETTINGS_SCHEMA "org.gnome.desktop.wm.preferences" + #define A11Y_SCHEMA "org.gnome.desktop.a11y" ++#define A11Y_INTERFACE_SCHEMA "org.gnome.desktop.a11y.interface" ++#define A11Y_APPLICATIONS_SCHEMA "org.gnome.desktop.a11y.applications" ++#define INPUT_SOURCES_SCHEMA "org.gnome.desktop.input-sources" + #define CLASSIC_WM_SETTINGS_SCHEMA "org.gnome.shell.extensions.classic-overrides" + + #define XSETTINGS_PLUGIN_SCHEMA "org.gnome.settings-daemon.plugins.xsettings" +@@ -72,9 +75,18 @@ + #define FONT_HINTING_KEY "font-hinting" + #define FONT_RGBA_ORDER_KEY "font-rgba-order" + ++#define INPUT_SOURCES_KEY "sources" ++#define OSK_ENABLED_KEY "screen-keyboard-enabled" ++#define GTK_IM_MODULE_KEY "gtk-im-module" ++ + #define GTK_SETTINGS_DBUS_PATH "/org/gtk/Settings" + #define GTK_SETTINGS_DBUS_NAME "org.gtk.Settings" + ++#define INPUT_SOURCE_TYPE_IBUS "ibus" ++ ++#define GTK_IM_MODULE_SIMPLE "gtk-im-context-simple" ++#define GTK_IM_MODULE_IBUS "ibus" ++ + static const gchar introspection_xml[] = + "" + " " +@@ -277,6 +289,11 @@ struct _GsdXSettingsManager + FcMonitor *fontconfig_monitor; + gint64 fontconfig_timestamp; + ++ GSettings *interface_settings; ++ GSettings *input_sources_settings; ++ GSettings *a11y_settings; ++ GdkSeat *user_seat; ++ + GsdXSettingsGtk *gtk; + + guint introspect_properties_changed_id; +@@ -286,6 +303,9 @@ struct _GsdXSettingsManager + guint display_config_watch_id; + guint monitors_changed_id; + ++ guint device_added_id; ++ guint device_removed_id; ++ + guint shell_name_watch_id; + gboolean have_shell; + +@@ -1291,6 +1311,112 @@ migrate_settings (void) + mouse_entries, G_N_ELEMENTS (mouse_entries)); + } + ++static gboolean ++need_ibus (GsdXSettingsManager *manager) ++{ ++ GVariant *sources; ++ GVariantIter iter; ++ const gchar *type; ++ gboolean needs_ibus = FALSE; ++ ++ sources = g_settings_get_value (manager->input_sources_settings, ++ INPUT_SOURCES_KEY); ++ ++ g_variant_iter_init (&iter, sources); ++ while (g_variant_iter_next (&iter, "(&s&s)", &type, NULL)) { ++ if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS)) { ++ needs_ibus = TRUE; ++ break; ++ } ++ } ++ ++ g_variant_unref (sources); ++ ++ return needs_ibus; ++} ++ ++static gboolean ++need_osk (GsdXSettingsManager *manager) ++{ ++ gboolean has_touchscreen = FALSE; ++ GList *devices; ++ GdkSeat *seat; ++ ++ if (g_settings_get_boolean (manager->a11y_settings, ++ OSK_ENABLED_KEY)) ++ return TRUE; ++ ++ seat = gdk_display_get_default_seat (gdk_display_get_default ()); ++ devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_TOUCH); ++ ++ has_touchscreen = devices != NULL; ++ ++ g_list_free (devices); ++ ++ return has_touchscreen; ++} ++ ++static void ++update_gtk_im_module (GsdXSettingsManager *manager) ++{ ++ const gchar *module; ++ gchar *setting; ++ ++ setting = g_settings_get_string (manager->interface_settings, ++ GTK_IM_MODULE_KEY); ++ if (setting && *setting) ++ module = setting; ++ else if (need_ibus (manager) || need_osk (manager)) ++ module = GTK_IM_MODULE_IBUS; ++ else ++ module = GTK_IM_MODULE_SIMPLE; ++ ++ xsettings_manager_set_string (manager->manager, "Gtk/IMModule", module); ++ g_free (setting); ++} ++ ++static void ++device_added_cb (GdkSeat *user_seat, ++ GdkDevice *device, ++ GsdXSettingsManager *manager) ++{ ++ GdkInputSource source; ++ ++ source = gdk_device_get_source (device); ++ if (source == GDK_SOURCE_TOUCHSCREEN) { ++ update_gtk_im_module (manager); ++ } ++} ++ ++static void ++device_removed_cb (GdkSeat *user_seat, ++ GdkDevice *device, ++ GsdXSettingsManager *manager) ++{ ++ GdkInputSource source; ++ ++ source = gdk_device_get_source (device); ++ if (source == GDK_SOURCE_TOUCHSCREEN) ++ update_gtk_im_module (manager); ++} ++ ++static void ++set_devicepresence_handler (GsdXSettingsManager *manager) ++{ ++ GdkSeat *user_seat; ++ ++ if (gnome_settings_is_wayland ()) ++ return; ++ ++ user_seat = gdk_display_get_default_seat (gdk_display_get_default ()); ++ ++ manager->device_added_id = g_signal_connect (G_OBJECT (user_seat), "device-added", ++ G_CALLBACK (device_added_cb), manager); ++ manager->device_removed_id = g_signal_connect (G_OBJECT (user_seat), "device-removed", ++ G_CALLBACK (device_removed_cb), manager); ++ manager->user_seat = user_seat; ++} ++ + gboolean + gsd_xsettings_manager_start (GsdXSettingsManager *manager, + GError **error) +@@ -1312,6 +1438,23 @@ gsd_xsettings_manager_start (GsdXSettingsManager *manager, + return FALSE; + } + ++ set_devicepresence_handler (manager); ++ manager->interface_settings = g_settings_new (INTERFACE_SETTINGS_SCHEMA); ++ g_signal_connect_swapped (manager->interface_settings, ++ "changed::" GTK_IM_MODULE_KEY, ++ G_CALLBACK (update_gtk_im_module), manager); ++ ++ manager->input_sources_settings = g_settings_new (INPUT_SOURCES_SCHEMA); ++ g_signal_connect_swapped (manager->input_sources_settings, ++ "changed::" INPUT_SOURCES_KEY, ++ G_CALLBACK (update_gtk_im_module), manager); ++ ++ manager->a11y_settings = g_settings_new (A11Y_APPLICATIONS_SCHEMA); ++ g_signal_connect_swapped (manager->a11y_settings, ++ "changed::" OSK_ENABLED_KEY, ++ G_CALLBACK (update_gtk_im_module), manager); ++ update_gtk_im_module (manager); ++ + manager->monitors_changed_id = + g_dbus_connection_signal_subscribe (manager->dbus_connection, + "org.gnome.Mutter.DisplayConfig", +@@ -1507,6 +1650,16 @@ gsd_xsettings_manager_stop (GsdXSettingsManager *manager) + g_object_unref (manager->gtk); + manager->gtk = NULL; + } ++ ++ if (manager->user_seat != NULL) { ++ g_signal_handler_disconnect (manager->user_seat, manager->device_added_id); ++ g_signal_handler_disconnect (manager->user_seat, manager->device_removed_id); ++ manager->user_seat = NULL; ++ } ++ ++ g_clear_object (&manager->a11y_settings); ++ g_clear_object (&manager->input_sources_settings); ++ g_clear_object (&manager->interface_settings); + } + + static void +-- +2.37.1 + + +From c1de15e0c7f145491482045c688e9f2d444cb041 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Tue, 15 Mar 2022 13:31:23 +0100 +Subject: [PATCH 2/3] keyboard: "Migrate" gtk-im-context setting before giving + control to user + +This setting used to be modified by gsd-keyboard at runtime, but it no +longer does. We want to leave this setting in a pristine state before +we lend control to the user in order to avoid setting leftovers make +GTK and others use the unintended IM module. + +Since the setting is actually staying on the same schema/path, there is +no nice mechanism that would help us in doing a one-time port, so rely +on a file at ~/.cache to make this happen once. In the common case, it +just adds one stat() more at startup. + +After this migration is done, the gtk-im-module setting can be considered +in full control of the user. +--- + plugins/keyboard/gsd-keyboard-manager.c | 35 +++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c +index d41393bc..15247c78 100644 +--- a/plugins/keyboard/gsd-keyboard-manager.c ++++ b/plugins/keyboard/gsd-keyboard-manager.c +@@ -67,6 +67,8 @@ + + #define DEFAULT_LAYOUT "us" + ++#define SETTINGS_PORTED_FILE ".gsd-keyboard.settings-ported" ++ + struct _GsdKeyboardManager + { + GObject parent; +@@ -541,6 +543,14 @@ gsd_keyboard_manager_finalize (GObject *object) + G_OBJECT_CLASS (gsd_keyboard_manager_parent_class)->finalize (object); + } + ++static GVariant * ++reset_gtk_im_module (GVariant *variant, ++ GVariant *old_default, ++ GVariant *new_default) ++{ ++ return NULL; ++} ++ + static void + migrate_keyboard_settings (void) + { +@@ -550,12 +560,37 @@ migrate_keyboard_settings (void) + { "delay", "delay", NULL }, + { "remember-numlock-state", "remember-numlock-state", NULL }, + }; ++ g_autofree char *filename = NULL; + + gsd_settings_migrate_check ("org.gnome.settings-daemon.peripherals.keyboard.deprecated", + "/org/gnome/settings-daemon/peripherals/keyboard/", + "org.gnome.desktop.peripherals.keyboard", + "/org/gnome/desktop/peripherals/keyboard/", + entries, G_N_ELEMENTS (entries)); ++ ++ /* In prior versions to GNOME 42, the gtk-im-module setting was ++ * owned by gsd-keyboard. Reset it once before giving it back ++ * to the user. ++ */ ++ filename = g_build_filename (g_get_user_config_dir (), ++ SETTINGS_PORTED_FILE, ++ NULL); ++ ++ if (!g_file_test (filename, G_FILE_TEST_EXISTS)) { ++ GsdSettingsMigrateEntry im_entry[] = { ++ { "gtk-im-module", "gtk-im-module", reset_gtk_im_module }, ++ }; ++ g_autoptr(GError) error = NULL; ++ ++ gsd_settings_migrate_check ("org.gnome.desktop.interface", ++ "/org/gnome/desktop/interface/", ++ "org.gnome.desktop.interface", ++ "/org/gnome/desktop/interface/", ++ im_entry, G_N_ELEMENTS (im_entry)); ++ ++ if (!g_file_set_contents (filename, "", -1, &error)) ++ g_warning ("Error migrating gtk-im-module: %s", error->message); ++ } + } + + GsdKeyboardManager * +-- +2.37.1 + + +From 46452c04aee1bfd51e23a53dba89ac95e0c06823 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Fri, 29 Apr 2022 14:37:27 +0200 +Subject: [PATCH 3/3] xsettings: Remove direct mapping from gtk-im-module to + Gtk/IMModule + +This is now handled dynamically since commit e2d268eb00, so we should +not tie dconf setting and Xsetting automatically here. Doing so, we +are clobbering the dynamic value on startup, making it only effective +on later changes. + +Fixes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/682 +--- + plugins/xsettings/gsd-xsettings-manager.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c +index 1aa020db..d692cefb 100644 +--- a/plugins/xsettings/gsd-xsettings-manager.c ++++ b/plugins/xsettings/gsd-xsettings-manager.c +@@ -498,7 +498,6 @@ static TranslationEntry translations [] = { + { "org.gnome.desktop.interface", "cursor-blink-time", "Net/CursorBlinkTime", translate_int_int }, + { "org.gnome.desktop.interface", "cursor-blink-timeout", "Gtk/CursorBlinkTimeout", translate_int_int }, + { "org.gnome.desktop.interface", "gtk-theme", "Net/ThemeName", translate_string_string }, +- { "org.gnome.desktop.interface", "gtk-im-module", "Gtk/IMModule", translate_string_string }, + { "org.gnome.desktop.interface", "icon-theme", "Net/IconThemeName", translate_string_string }, + { "org.gnome.desktop.interface", "cursor-theme", "Gtk/CursorThemeName", translate_string_string }, + { "org.gnome.desktop.interface", "gtk-enable-primary-paste", "Gtk/EnablePrimaryPaste", translate_bool_int }, +-- +2.37.1 + diff --git a/SOURCES/subscription-manager-support.patch b/SOURCES/subscription-manager-support.patch index 5624f0a..a098a55 100644 --- a/SOURCES/subscription-manager-support.patch +++ b/SOURCES/subscription-manager-support.patch @@ -1,7 +1,7 @@ -From d85d6eb0ceeaabc65f71ec9b163d00a1e0840b81 Mon Sep 17 00:00:00 2001 +From f73e1e8187570ddbc2fe40a78176689f12859123 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 20 Aug 2020 11:16:09 -0400 -Subject: [PATCH 01/19] subman: Add a new plugin to provide system subscription +Subject: [PATCH 01/20] subman: Add a new plugin to provide system subscription registration --- @@ -10,7 +10,7 @@ Subject: [PATCH 01/19] subman: Add a new plugin to provide system subscription plugins/subman/README.md | 56 + plugins/subman/gsd-subman-common.c | 36 + plugins/subman/gsd-subman-common.h | 40 + - plugins/subman/gsd-subman-helper.c | 378 +++++++ + plugins/subman/gsd-subman-helper.c | 372 +++++++ plugins/subman/gsd-subscription-manager.c | 982 ++++++++++++++++++ plugins/subman/gsd-subscription-manager.h | 63 ++ plugins/subman/main.c | 8 + @@ -18,7 +18,7 @@ Subject: [PATCH 01/19] subman: Add a new plugin to provide system subscription ...ome.SettingsDaemon.Subscription.desktop.in | 9 + ...ettings-daemon.plugins.subman.policy.in.in | 27 + ...gnome.settings-daemon.plugins.subman.rules | 7 + - 13 files changed, 1664 insertions(+) + 13 files changed, 1658 insertions(+) create mode 100644 plugins/subman/README.md create mode 100644 plugins/subman/gsd-subman-common.c create mode 100644 plugins/subman/gsd-subman-common.h @@ -207,7 +207,7 @@ index 00000000..fccf9f6a +#endif /* __GSD_SUBMAN_COMMON_H */ diff --git a/plugins/subman/gsd-subman-helper.c b/plugins/subman/gsd-subman-helper.c new file mode 100644 -index 00000000..182f7190 +index 00000000..69ebec7e --- /dev/null +++ b/plugins/subman/gsd-subman-helper.c @@ -0,0 +1,372 @@ @@ -1778,13 +1778,13 @@ index 00000000..1ed3a0ea + } +}); -- -2.31.1 +2.37.0 -From dd5490fb4e962d82598bbf83d0dc600c030a10a3 Mon Sep 17 00:00:00 2001 +From d85f9992ac4b413d07092363568213991f38d898 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Thu, 27 Jun 2019 16:12:00 +0200 -Subject: [PATCH 02/19] subman: Add InstalledProducts dbus property for g-c-c +Subject: [PATCH 02/20] subman: Add InstalledProducts dbus property for g-c-c --- plugins/subman/gsd-subscription-manager.c | 135 ++++++++++++++++++++++ @@ -2028,13 +2028,13 @@ index 08b13fa6..a8c18a26 100644 "Failed to get property: %s", property_name); return NULL; -- -2.31.1 +2.37.0 -From c67554c7ab37a4fea6abc80ca199de2671c34ee2 Mon Sep 17 00:00:00 2001 +From 65750e137dc591d34c1166de28ce2f73eb17d51e Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 28 Jun 2019 18:10:36 +0200 -Subject: [PATCH 03/19] subman: Increase RHSM dbus call timeouts +Subject: [PATCH 03/20] subman: Increase RHSM dbus call timeouts Increase the dbus timeouts to 5 minutes as the register/unregister calls seem to routinely take more than a minute. @@ -2043,7 +2043,7 @@ seem to routinely take more than a minute. 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/subman/gsd-subman-helper.c b/plugins/subman/gsd-subman-helper.c -index 182f7190..af7a82e9 100644 +index 69ebec7e..a649ae03 100644 --- a/plugins/subman/gsd-subman-helper.c +++ b/plugins/subman/gsd-subman-helper.c @@ -28,6 +28,8 @@ @@ -2085,7 +2085,7 @@ index 182f7190..af7a82e9 100644 return res != NULL; } -@@ -305,7 +310,8 @@ main (int argc, char *argv[]) +@@ -307,7 +312,8 @@ main (int argc, char *argv[]) subman_conopts, userlang), G_DBUS_CALL_FLAGS_NO_AUTO_START, @@ -2095,7 +2095,7 @@ index 182f7190..af7a82e9 100644 if (res == NULL) { g_dbus_error_strip_remote_error (error_local); _helper_convert_error (error_local->message, &error); -@@ -339,7 +345,8 @@ main (int argc, char *argv[]) +@@ -341,7 +347,8 @@ main (int argc, char *argv[]) subman_conopts, userlang), G_DBUS_CALL_FLAGS_NO_AUTO_START, @@ -2106,13 +2106,13 @@ index 182f7190..af7a82e9 100644 g_dbus_error_strip_remote_error (error_local); _helper_convert_error (error_local->message, &error); -- -2.31.1 +2.37.0 -From efcbbf6a50eca888bde03f4425578bab9916ebaa Mon Sep 17 00:00:00 2001 +From cbbaf0ac6b826e38c38eba401e4afc5f71708389 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 20 Aug 2020 11:20:47 -0400 -Subject: [PATCH 04/19] subman: Drop userlang field +Subject: [PATCH 04/20] subman: Drop userlang field It's currently always erroneously set to empty string. @@ -2197,13 +2197,13 @@ index a8c18a26..46f051a5 100644 return FALSE; if (!_client_subscription_status_update (manager, error)) -- -2.31.1 +2.37.0 -From 3ff6f889049462b2b3029e26f7251e39904a3ddf Mon Sep 17 00:00:00 2001 +From be0e7fdd2e19a1322e0c69081b8a2bf8d62d743a Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 24 Jan 2021 15:04:17 -0500 -Subject: [PATCH 05/19] subman: Use user locale for registration/subscription +Subject: [PATCH 05/20] subman: Use user locale for registration/subscription operations This makes sure that error messages are in the correct locale. @@ -2212,7 +2212,7 @@ This makes sure that error messages are in the correct locale. 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/subman/gsd-subman-helper.c b/plugins/subman/gsd-subman-helper.c -index af7a82e9..f84e91bf 100644 +index a649ae03..3c892c33 100644 --- a/plugins/subman/gsd-subman-helper.c +++ b/plugins/subman/gsd-subman-helper.c @@ -24,11 +24,13 @@ @@ -2275,7 +2275,7 @@ index af7a82e9..f84e91bf 100644 g_option_context_add_main_entries (context, options, NULL); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_printerr ("Failed to parse arguments: %s\n", error->message); -@@ -308,7 +313,7 @@ main (int argc, char *argv[]) +@@ -310,7 +315,7 @@ main (int argc, char *argv[]) activation_keys, subman_options, subman_conopts, @@ -2284,7 +2284,7 @@ index af7a82e9..f84e91bf 100644 G_DBUS_CALL_FLAGS_NO_AUTO_START, DBUS_TIMEOUT, NULL, &error_local); -@@ -343,7 +348,7 @@ main (int argc, char *argv[]) +@@ -345,7 +350,7 @@ main (int argc, char *argv[]) password, subman_options, subman_conopts, @@ -2294,13 +2294,13 @@ index af7a82e9..f84e91bf 100644 DBUS_TIMEOUT, NULL, &error_local); -- -2.31.1 +2.37.0 -From 7bdca155acbe043c82e7abd9d2072c6502e10270 Mon Sep 17 00:00:00 2001 +From a45af9d440fc55c1df3e4f12d15129d50d89f792 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 20 Aug 2020 13:34:19 -0400 -Subject: [PATCH 06/19] subman: Handle subscription-manager giving invalid +Subject: [PATCH 06/20] subman: Handle subscription-manager giving invalid status better subscription-manager potentially returns status messages that the @@ -2423,13 +2423,13 @@ index 46f051a5..e2c16056 100644 /* emit notification for g-c-c */ if (priv->subscription_status != priv->subscription_status_last) { -- -2.31.1 +2.37.0 -From 74fe856b8d2826520a7d324abe9727097cce8cfb Mon Sep 17 00:00:00 2001 +From 609e78ba17ee5610b35dd40f9763ca91306c3535 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 25 Aug 2020 10:34:03 -0400 -Subject: [PATCH 07/19] subman: Force re-subscribe if the admin already +Subject: [PATCH 07/20] subman: Force re-subscribe if the admin already subscribed It's possible for an admin to to half-enroll the system with RHN, @@ -2451,7 +2451,7 @@ before registering. 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/subman/gsd-subman-helper.c b/plugins/subman/gsd-subman-helper.c -index f84e91bf..3931ef2e 100644 +index 3c892c33..c248dbc3 100644 --- a/plugins/subman/gsd-subman-helper.c +++ b/plugins/subman/gsd-subman-helper.c @@ -78,7 +78,6 @@ _helper_unregister (GError **error) @@ -2470,7 +2470,7 @@ index f84e91bf..3931ef2e 100644 if (!_helper_unregister (&error)) { g_printerr ("Failed to Unregister: %s\n", error->message); return G_IO_ERROR_NOT_INITIALIZED; -@@ -304,6 +304,9 @@ main (int argc, char *argv[]) +@@ -306,6 +306,9 @@ main (int argc, char *argv[]) return G_IO_ERROR_INVALID_DATA; } @@ -2480,7 +2480,7 @@ index f84e91bf..3931ef2e 100644 g_debug ("registering using activation key"); activation_keys = g_strsplit (activation_key, ",", -1); res = g_dbus_proxy_call_sync (proxy, -@@ -327,7 +330,6 @@ main (int argc, char *argv[]) +@@ -329,7 +332,6 @@ main (int argc, char *argv[]) g_autoptr(GError) error_local = NULL; g_autoptr(GVariant) res = NULL; @@ -2488,7 +2488,7 @@ index f84e91bf..3931ef2e 100644 if (username == NULL) { g_printerr ("Required --username\n"); return G_IO_ERROR_INVALID_DATA; -@@ -340,6 +342,11 @@ main (int argc, char *argv[]) +@@ -342,6 +344,11 @@ main (int argc, char *argv[]) g_printerr ("Required --organisation\n"); return G_IO_ERROR_INVALID_DATA; } @@ -2501,13 +2501,13 @@ index f84e91bf..3931ef2e 100644 "Register", g_variant_new ("(sssa{ss}a{ss}s)", -- -2.31.1 +2.37.0 -From c0ca9c55632a52371acbbb76a279f28e26532e5e Mon Sep 17 00:00:00 2001 +From c189fe1089c1f1975352b1a7fbe41f31ad3adc3b Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 25 Aug 2020 16:20:42 -0400 -Subject: [PATCH 08/19] subman: Don't send secrets through command line +Subject: [PATCH 08/20] subman: Don't send secrets through command line The command line is introspectable with "ps", and it even gets logged to syslog, so it's not suitable for passing secrets. @@ -2523,7 +2523,7 @@ stdin, instead. 3 files changed, 66 insertions(+), 20 deletions(-) diff --git a/plugins/subman/gsd-subman-helper.c b/plugins/subman/gsd-subman-helper.c -index 3931ef2e..edf1e41f 100644 +index c248dbc3..03d2cd64 100644 --- a/plugins/subman/gsd-subman-helper.c +++ b/plugins/subman/gsd-subman-helper.c @@ -21,12 +21,14 @@ @@ -2570,7 +2570,7 @@ index 3931ef2e..edf1e41f 100644 { "hostname", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &hostname, "Registration server hostname", NULL }, { "prefix", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, -@@ -294,16 +292,20 @@ main (int argc, char *argv[]) +@@ -296,16 +294,20 @@ main (int argc, char *argv[]) g_auto(GStrv) activation_keys = NULL; g_autoptr(GError) error_local = NULL; g_autoptr(GVariant) res = NULL; @@ -2595,7 +2595,7 @@ index 3931ef2e..edf1e41f 100644 g_debug ("trying to unregister in case machine is already registered"); _helper_unregister (NULL); -@@ -329,20 +331,24 @@ main (int argc, char *argv[]) +@@ -331,20 +333,24 @@ main (int argc, char *argv[]) } else if (g_strcmp0 (kind, "register-with-username") == 0) { g_autoptr(GError) error_local = NULL; g_autoptr(GVariant) res = NULL; @@ -2751,13 +2751,13 @@ index bfd073b6..e4b4589d 100644 install_rpath: gsd_pkglibdir, install_dir: gsd_libexecdir -- -2.31.1 +2.37.0 -From 590ad191dc3fec6c21dbfd22a5fc757a1409edbf Mon Sep 17 00:00:00 2001 +From 3398c5037f9bdf2f6d3d2161146a6edea6c144f2 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 21 Jan 2021 09:52:19 -0500 -Subject: [PATCH 09/19] subman: Don't treat failure to attach as fatal +Subject: [PATCH 09/20] subman: Don't treat failure to attach as fatal Many organizations don't require specific subscriptions to get updates (called "simple content access"). At the moment, @@ -2769,7 +2769,7 @@ This commit quiets the error. 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/plugins/subman/gsd-subman-helper.c b/plugins/subman/gsd-subman-helper.c -index edf1e41f..53a4d56b 100644 +index 03d2cd64..ddfe389f 100644 --- a/plugins/subman/gsd-subman-helper.c +++ b/plugins/subman/gsd-subman-helper.c @@ -52,6 +52,17 @@ _helper_convert_error (const gchar *json_txt, GError **error) @@ -2835,7 +2835,7 @@ index edf1e41f..53a4d56b 100644 g_variant_get (res, "(&s)", &str); g_debug ("Attach.AutoAttach: %s", str); return TRUE; -@@ -325,8 +349,10 @@ main (int argc, char *argv[]) +@@ -327,8 +351,10 @@ main (int argc, char *argv[]) if (res == NULL) { g_dbus_error_strip_remote_error (error_local); _helper_convert_error (error_local->message, &error); @@ -2848,7 +2848,7 @@ index edf1e41f..53a4d56b 100644 } } else if (g_strcmp0 (kind, "register-with-username") == 0) { g_autoptr(GError) error_local = NULL; -@@ -368,8 +394,10 @@ main (int argc, char *argv[]) +@@ -370,8 +396,10 @@ main (int argc, char *argv[]) if (res == NULL) { g_dbus_error_strip_remote_error (error_local); _helper_convert_error (error_local->message, &error); @@ -2862,13 +2862,13 @@ index edf1e41f..53a4d56b 100644 } else { g_printerr ("Invalid --kind specified: %s\n", kind); -- -2.31.1 +2.37.0 -From 8c076516d48b5603132d3586a8040ef46011330f Mon Sep 17 00:00:00 2001 +From ae88d09fd12a971d5f60c5eee5d3b7710e4884be Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 24 Jan 2021 11:24:36 -0500 -Subject: [PATCH 10/19] subman: Add new no-installed-products state +Subject: [PATCH 10/20] subman: Add new no-installed-products state It's possible, though unlikley, the system has no packages installed from Red Hat supported package sets. @@ -2961,13 +2961,13 @@ index 0838d490..46f8d35c 100644 return FALSE; -- -2.31.1 +2.37.0 -From fad6580e4cf9e7f350d0d537a064bbb439457540 Mon Sep 17 00:00:00 2001 +From 18e5e5862aba2031d1a93671ad8156dcc7709eaf Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 24 Jan 2021 11:26:40 -0500 -Subject: [PATCH 11/19] subman: Fix some build warnings +Subject: [PATCH 11/20] subman: Fix some build warnings --- plugins/subman/gsd-subscription-manager.c | 8 ++++---- @@ -3000,13 +3000,13 @@ index 46f8d35c..1f9ca447 100644 /* FIXME: also do on error? */ -- -2.31.1 +2.37.0 -From 6c99ee2eee9a1be3765db5a7b80ae86a4444f00b Mon Sep 17 00:00:00 2001 +From f3f5369b1d68f002b020f803fb59cdcb3205e6dc Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 24 Jan 2021 11:27:42 -0500 -Subject: [PATCH 12/19] subman: Add DBus API to subscribe for updates on +Subject: [PATCH 12/20] subman: Add DBus API to subscribe for updates on already registered system It's possible an admin may have registered their system without @@ -3098,13 +3098,13 @@ index 1f9ca447..705f8b11 100644 g_assert_not_reached (); } -- -2.31.1 +2.37.0 -From b340559f941ebd012711f357a8a0095776222d7a Mon Sep 17 00:00:00 2001 +From d00d1c34921d6301579ee29a51be89ce8250e83d Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 24 Jan 2021 11:34:03 -0500 -Subject: [PATCH 13/19] subman: Improve subscription status handling +Subject: [PATCH 13/20] subman: Improve subscription status handling This commit improves how subscription-manager status is parsed to give more detailed information about subscription @@ -3177,13 +3177,13 @@ index 705f8b11..6d80bfa9 100644 if (priv->subscription_status != priv->subscription_status_last) { _emit_property_changed (manager, "SubscriptionStatus", -- -2.31.1 +2.37.0 -From e2caf6d353dfe6e3314be9c2e604dd4c025d7dc1 Mon Sep 17 00:00:00 2001 +From a3d4e534a1dfa6a6ff68d0bede69e063ffeeb4d7 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 24 Jan 2021 11:55:19 -0500 -Subject: [PATCH 14/19] subman: Drop "LAST" from status enum +Subject: [PATCH 14/20] subman: Drop "LAST" from status enum It's unused, so get rid of it. --- @@ -3203,13 +3203,13 @@ index f8a3d9f4..88226564 100644 const gchar *gsd_subman_subscription_status_to_string (GsdSubmanSubscriptionStatus status); -- -2.31.1 +2.37.0 -From 26ff144e7c5230f8b27a27e6eef5c109ae31ab0f Mon Sep 17 00:00:00 2001 +From 78859ea58014ee740de0c484308b6dedf4c59ab3 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 24 Jan 2021 12:41:20 -0500 -Subject: [PATCH 15/19] subman: Clean up notification behavior +Subject: [PATCH 15/20] subman: Clean up notification behavior Notifications were only displayed for some status transitions. @@ -3427,13 +3427,13 @@ index 6d80bfa9..aaccbbc6 100644 /* expired */ priv->notification_expired = -- -2.31.1 +2.37.0 -From e4ecab298c016127ab75634e1e04c6ff4eab3c4e Mon Sep 17 00:00:00 2001 +From f9a405172b08607777b47c03dbd1034227690fce Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 12 Feb 2021 14:51:29 +0100 -Subject: [PATCH 16/19] subman: Update POTFILES.in +Subject: [PATCH 16/20] subman: Update POTFILES.in --- po/POTFILES.in | 2 ++ @@ -3453,13 +3453,13 @@ index e721f526..7d5b7e9d 100644 plugins/wacom/gsd-wacom-manager.c plugins/wacom/org.gnome.settings-daemon.plugins.wacom.policy.in.in -- -2.31.1 +2.37.0 -From 0da1131d81b5ddee23d5afe9c21e8c0963180cc5 Mon Sep 17 00:00:00 2001 +From 957d7916a843140898f7a3ca2adeb826cd5e6a99 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 6 Sep 2021 21:31:14 +0200 -Subject: [PATCH 17/19] subman: Don't force X11 backend +Subject: [PATCH 17/20] subman: Don't force X11 backend All of this should work just fine with Wayland. --- @@ -3479,13 +3479,13 @@ index 28ac995b..839c1b79 100644 #include "daemon-skeleton-gtk.h" -- -2.31.1 +2.37.0 -From 7b2f231fd6c87ca929bdd099177c53b14ccaaad5 Mon Sep 17 00:00:00 2001 +From ea88e09c4e9cb2a6dc67740d556f52761297f5b6 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 7 Sep 2021 13:08:12 +0200 -Subject: [PATCH 18/19] subman: Fix desktop file hint for notifications +Subject: [PATCH 18/20] subman: Fix desktop file hint for notifications We don't have a separate subman-panel. It's all part of info-overview-panel, as of now at least. @@ -3525,13 +3525,13 @@ index aaccbbc6..be978fc3 100644 notify_notification_set_urgency (priv->notification_registration_required, NOTIFY_URGENCY_CRITICAL); notify_notification_add_action (priv->notification_registration_required, -- -2.31.1 +2.37.0 -From b610a954773262e60610c7732fbfeddbb3fa7fa0 Mon Sep 17 00:00:00 2001 +From 3b21bc12315dba099d7377b55109bc5f942960f2 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 8 Sep 2021 13:25:07 +0200 -Subject: [PATCH 19/19] subman: Use preferences-system icon for notifications +Subject: [PATCH 19/20] subman: Use preferences-system icon for notifications Use it as a placeholder until we get a new icon for subscription management. @@ -3571,5 +3571,42 @@ index be978fc3..dbb81098 100644 notify_notification_set_hint_string (priv->notification_registration_required, "desktop-entry", "gnome-info-overview-panel"); notify_notification_set_hint_string (priv->notification_registration_required, "x-gnome-privacy-scope", "system"); -- -2.31.1 +2.37.0 + + +From b7da34ad4cfb05a3d50495da65a7d76abacc965f Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Fri, 15 Jul 2022 15:25:14 +0200 +Subject: [PATCH 20/20] subman: Set "enable_content" option only for Register + +The "enable_content" option doesn't work for +RegisterWithActivationKey. +--- + plugins/subman/gsd-subman-helper.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plugins/subman/gsd-subman-helper.c b/plugins/subman/gsd-subman-helper.c +index ddfe389f..bc56a8c2 100644 +--- a/plugins/subman/gsd-subman-helper.c ++++ b/plugins/subman/gsd-subman-helper.c +@@ -299,8 +299,6 @@ main (int argc, char *argv[]) + /* enable_content=1 auto attaches the subscription */ + subman_options = g_variant_builder_new (G_VARIANT_TYPE("a{ss}")); + +- g_variant_builder_add (subman_options, "{ss}", "enable_content", "1"); +- + /* set registration server */ + if (hostname == NULL || hostname[0] == '\0') + hostname = g_strdup ("subscription.rhsm.redhat.com"); +@@ -361,6 +359,8 @@ main (int argc, char *argv[]) + g_autoptr(GVariant) res = NULL; + gchar password[PIPE_BUF + 1] = ""; + ++ g_variant_builder_add (subman_options, "{ss}", "enable_content", "1"); ++ + if (username == NULL) { + g_printerr ("Required --username\n"); + return G_IO_ERROR_INVALID_DATA; +-- +2.37.0 diff --git a/SPECS/gnome-settings-daemon.spec b/SPECS/gnome-settings-daemon.spec index 1d2d892..441bad7 100644 --- a/SPECS/gnome-settings-daemon.spec +++ b/SPECS/gnome-settings-daemon.spec @@ -11,7 +11,7 @@ Name: gnome-settings-daemon Version: 40.0.1 -Release: 6%{?dist} +Release: 8%{?dist} Summary: The daemon sharing settings from GNOME to GTK+/KDE applications License: GPLv2+ @@ -69,6 +69,7 @@ Requires: libgweather%{?_isa} >= %{libgweather_version} Patch00001: 0001-power-Enable-power-saver-profile-when-low-on-battery.patch Patch00002: subscription-manager-support.patch +Patch00003: im-module-setting-fix.patch %description A daemon to share settings from GNOME to other applications. It also @@ -194,6 +195,14 @@ cp %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/glib-2.0/schemas %{_libdir}/pkgconfig/gnome-settings-daemon.pc %changelog +* Mon Aug 01 2022 Felipe Borges - 40.0.1-8 +- Fix registration with activation key + Resolves: #2100467 + +* Wed Jul 13 2022 Carlos Garnacho - 40.0.1-7 +- Manage im-context Xsetting dynamically + Resolves: #2087031 + * Mon Feb 14 2022 Ray Strode - 40.0.1-6 - Update for non-deprecated subscription management API Resolves: #2049734