From c0c25f9b1ce94c1f78aed7cd431d22771a3af184 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2020 09:40:02 +0000 Subject: import gnome-settings-daemon-3.28.1-8.el7 --- diff --git a/SOURCES/0001-common-Add-display-mapping-check-specific-for-the-De.patch b/SOURCES/0001-common-Add-display-mapping-check-specific-for-the-De.patch new file mode 100644 index 0000000..ab48a09 --- /dev/null +++ b/SOURCES/0001-common-Add-display-mapping-check-specific-for-the-De.patch @@ -0,0 +1,52 @@ +From 5abebf19fe8c09ec6e91027634b4c1727365b849 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Fri, 6 Sep 2019 20:48:20 +0200 +Subject: [PATCH] common: Add display mapping check specific for the Dell + Canvas. + +--- + plugins/common/gsd-device-mapper.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/plugins/common/gsd-device-mapper.c b/plugins/common/gsd-device-mapper.c +index d4f7bc3..e5b5ea3 100644 +--- a/plugins/common/gsd-device-mapper.c ++++ b/plugins/common/gsd-device-mapper.c +@@ -56,6 +56,7 @@ typedef enum { + typedef enum { + GSD_PRIO_BUILTIN, /* Output is builtin, applies mainly to system-integrated devices */ + GSD_PRIO_MATCH_SIZE, /* Size from input device and output match */ ++ GSD_PRIO_EDID_DELL_CANVAS, /* EDID is Dell Canvas' */ + GSD_PRIO_EDID_MATCH_FULL, /* Full EDID model match, eg. "Cintiq 12WX" */ + GSD_PRIO_EDID_MATCH_PARTIAL, /* Partial EDID model match, eg. "Cintiq" */ + GSD_PRIO_EDID_MATCH_VENDOR, /* EDID vendor match, eg. "WAC" for Wacom */ +@@ -249,7 +250,7 @@ input_info_guess_candidates (GsdInputInfo *input, + GnomeRROutput *outputs[N_OUTPUT_PRIORITIES]) + { + gboolean found = FALSE; +- const gchar *name; ++ const gchar *name, *vendor, *product; + gchar **split; + gint i; + +@@ -261,6 +262,17 @@ input_info_guess_candidates (GsdInputInfo *input, + } + + split = g_strsplit (name, " ", -1); ++ gsd_device_get_device_ids (input->device, &vendor, &product); ++ ++ if (input->capabilities & GSD_INPUT_IS_SCREEN_INTEGRATED && ++ g_strcmp0 (vendor, "2575") == 0 && ++ g_strcmp0 (product, "0204") == 0) { ++ const gchar *edid[3] = { "DEL", "Dell KV2718D", NULL }; ++ ++ outputs[GSD_PRIO_EDID_DELL_CANVAS] = ++ find_output_by_edid (input->mapper->rr_screen, edid); ++ found |= outputs[GSD_PRIO_EDID_DELL_CANVAS] != NULL; ++ } + + /* On Wacom devices that are integrated on a not-in-system screen (eg. Cintiqs), + * there is usually a minimal relation between the input device name and the EDID +-- +2.23.0 + diff --git a/SOURCES/0001-rfkill-Use-GUdev-to-monitor-rfkill-device-presence.patch b/SOURCES/0001-rfkill-Use-GUdev-to-monitor-rfkill-device-presence.patch new file mode 100644 index 0000000..6a14eb0 --- /dev/null +++ b/SOURCES/0001-rfkill-Use-GUdev-to-monitor-rfkill-device-presence.patch @@ -0,0 +1,241 @@ +From e4bc5b81dea5c0bfbfb42a929ea273fe19e72d7c Mon Sep 17 00:00:00 2001 +From: Benjamin Berg +Date: Tue, 28 Aug 2018 13:05:59 +0200 +Subject: [PATCH] rfkill: Use GUdev to monitor rfkill device presence + +This adds the required code to use GUdev to monitor for the existence of +the rfkill device. This is relevant as the rfkill device might not exist +initially if the rfkill module is not loaded during login. + +Fixes issue #52 +--- + meson.build | 1 + + plugins/rfkill/meson.build | 7 ++- + plugins/rfkill/rfkill-glib.c | 99 +++++++++++++++++++++++++++++++----- + 3 files changed, 94 insertions(+), 13 deletions(-) + +diff --git a/meson.build b/meson.build +index c94c4f85..7510f816 100644 +--- a/meson.build ++++ b/meson.build +@@ -182,6 +182,7 @@ enable_rfkill = get_option('rfkill') + assert(enable_rfkill or not host_is_linux, 'rfkill is not optional on Linux platforms') + if enable_rfkill + assert(cc.has_header('linux/rfkill.h'), 'rfkill support requested but RFKill headers not found') ++ assert(enable_gudev, 'GUdev is required for rfkill support') + + udev_dir = get_option('udev_dir') + if udev_dir == '' +diff --git a/plugins/rfkill/meson.build b/plugins/rfkill/meson.build +index b85620b4..4d70352a 100644 +--- a/plugins/rfkill/meson.build ++++ b/plugins/rfkill/meson.build +@@ -9,7 +9,12 @@ sources = files( + 'main.c' + ) + +-deps = plugins_deps + [gio_unix_dep] ++deps = plugins_deps ++deps += [ ++ gio_unix_dep, ++ gudev_dep, ++ m_dep ++] + + executable( + 'gsd-' + plugin_name, +diff --git a/plugins/rfkill/rfkill-glib.c b/plugins/rfkill/rfkill-glib.c +index 9862105e..0dc26f92 100644 +--- a/plugins/rfkill/rfkill-glib.c ++++ b/plugins/rfkill/rfkill-glib.c +@@ -38,6 +38,7 @@ + #include + + #include "rfkill-glib.h" ++#include + + enum { + CHANGED, +@@ -53,11 +54,15 @@ static int signals[LAST_SIGNAL] = { 0 }; + struct _CcRfkillGlib { + GObject parent; + ++ GUdevClient *udev; ++ gchar *device_file; ++ + GOutputStream *stream; + GIOChannel *channel; + guint watch_id; + + /* rfkill-input inhibitor */ ++ gboolean noinput; + int noinput_fd; + + /* Pending Bluetooth enablement. +@@ -374,12 +379,13 @@ event_cb (GIOChannel *source, + static void + cc_rfkill_glib_init (CcRfkillGlib *rfkill) + { ++ rfkill->device_file = NULL; + rfkill->noinput_fd = -1; + } + +-gboolean +-cc_rfkill_glib_open (CcRfkillGlib *rfkill, +- GError **error) ++static gboolean ++_cc_rfkill_glib_open (CcRfkillGlib *rfkill, ++ GError **error) + { + int fd; + int ret; +@@ -387,8 +393,10 @@ cc_rfkill_glib_open (CcRfkillGlib *rfkill, + + g_return_val_if_fail (CC_RFKILL_IS_GLIB (rfkill), FALSE); + g_return_val_if_fail (rfkill->stream == NULL, FALSE); ++ g_assert (rfkill->device_file); ++ ++ fd = open (rfkill->device_file, O_RDWR); + +- fd = open("/dev/rfkill", O_RDWR); + if (fd < 0) { + g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errno), + "Could not open RFKILL control device, please verify your installation"); +@@ -455,6 +463,60 @@ cc_rfkill_glib_open (CcRfkillGlib *rfkill, + return TRUE; + } + ++static void ++uevent_cb (GUdevClient *client, ++ gchar *action, ++ GUdevDevice *device, ++ gpointer user_data) ++{ ++ CcRfkillGlib *rfkill = CC_RFKILL_GLIB (user_data); ++ ++ if (g_strcmp0 (action, "add") != 0) ++ return; ++ ++ if (g_strcmp0 (g_udev_device_get_name (device), "rfkill") == 0) { ++ g_autoptr(GError) error = NULL; ++ ++ g_debug ("Rfkill device has been created"); ++ ++ if (g_udev_device_get_device_file (device)) { ++ g_clear_pointer (&rfkill->device_file, g_free); ++ rfkill->device_file = g_strdup (g_udev_device_get_device_file (device)); ++ } else { ++ g_warning ("rfkill udev device does not have a device file!"); ++ } ++ ++ if (!_cc_rfkill_glib_open (rfkill, &error)) ++ g_warning ("Could not open rfkill device: %s", error->message); ++ else ++ g_debug ("Opened rfkill device after uevent"); ++ ++ g_clear_object (&rfkill->udev); ++ ++ /* Sync rfkill input inhibition state*/ ++ cc_rfkill_glib_set_rfkill_input_inhibited (rfkill, rfkill->noinput); ++ } ++} ++ ++gboolean ++cc_rfkill_glib_open (CcRfkillGlib *rfkill, ++ GError **error) ++{ ++ const char * const subsystems[] = { "misc", NULL }; ++ GUdevDevice *device; ++ ++ rfkill->udev = g_udev_client_new (subsystems); ++ g_debug ("Setting up uevent listener"); ++ g_signal_connect (rfkill->udev, "uevent", G_CALLBACK (uevent_cb), rfkill); ++ ++ /* Simulate uevent if device already exists. */ ++ device = g_udev_client_query_by_subsystem_and_name (rfkill->udev, "misc", "rfkill"); ++ if (device) ++ uevent_cb (rfkill->udev, "add", device, rfkill); ++ ++ return TRUE; ++} ++ + #define RFKILL_INPUT_INHIBITED(rfkill) (rfkill->noinput_fd >= 0) + + gboolean +@@ -462,7 +524,7 @@ cc_rfkill_glib_get_rfkill_input_inhibited (CcRfkillGlib *rfkill) + { + g_return_val_if_fail (CC_RFKILL_IS_GLIB (rfkill), FALSE); + +- return RFKILL_INPUT_INHIBITED(rfkill); ++ return rfkill->noinput; + } + + void +@@ -471,21 +533,28 @@ cc_rfkill_glib_set_rfkill_input_inhibited (CcRfkillGlib *rfkill, + { + g_return_if_fail (CC_RFKILL_IS_GLIB (rfkill)); + +- /* Nothing to do if the states already match. */ +- if (RFKILL_INPUT_INHIBITED(rfkill) == inhibit) ++ /* Shortcut in case we don't have an rfkill device */ ++ if (!rfkill->stream) { ++ if (rfkill->noinput == inhibit) ++ return; ++ ++ rfkill->noinput = inhibit; ++ g_object_notify (G_OBJECT (rfkill), "rfkill-input-inhibited"); ++ + return; ++ } + + if (!inhibit && RFKILL_INPUT_INHIBITED(rfkill)) { + close (rfkill->noinput_fd); +- rfkill->noinput_fd = -1; +- + g_debug ("Closed rfkill noinput FD."); ++ ++ rfkill->noinput_fd = -1; + } + + if (inhibit && !RFKILL_INPUT_INHIBITED(rfkill)) { + int fd, res; + /* Open write only as we don't want to do any IO to it ever. */ +- fd = open ("/dev/rfkill", O_WRONLY); ++ fd = open (rfkill->device_file, O_WRONLY); + if (fd < 0) { + if (errno == EACCES) + g_warning ("Could not open RFKILL control device, please verify your installation"); +@@ -506,7 +575,10 @@ cc_rfkill_glib_set_rfkill_input_inhibited (CcRfkillGlib *rfkill, + rfkill->noinput_fd = fd; + } + +- g_object_notify (G_OBJECT (rfkill), "rfkill-input-inhibited"); ++ if (rfkill->noinput != RFKILL_INPUT_INHIBITED(rfkill)) { ++ rfkill->noinput = RFKILL_INPUT_INHIBITED(rfkill); ++ g_object_notify (G_OBJECT (rfkill), "rfkill-input-inhibited"); ++ } + } + + static void +@@ -537,7 +609,7 @@ cc_rfkill_glib_get_property (GObject *object, + + switch (prop_id) { + case PROP_RFKILL_INPUT_INHIBITED: +- g_value_set_boolean (value, RFKILL_INPUT_INHIBITED(rfkill)); ++ g_value_set_boolean (value, rfkill->noinput); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); +@@ -566,6 +638,9 @@ cc_rfkill_glib_finalize (GObject *object) + rfkill->noinput_fd = -1; + } + ++ g_clear_pointer (&rfkill->device_file, g_free); ++ g_clear_object (&rfkill->udev); ++ + G_OBJECT_CLASS(cc_rfkill_glib_parent_class)->finalize(object); + } + +-- +2.23.0.rc1 + diff --git a/SOURCES/0001-xsettings-don-t-complain-at-start-up-when-fetching-w.patch b/SOURCES/0001-xsettings-don-t-complain-at-start-up-when-fetching-w.patch new file mode 100644 index 0000000..c11b0ee --- /dev/null +++ b/SOURCES/0001-xsettings-don-t-complain-at-start-up-when-fetching-w.patch @@ -0,0 +1,270 @@ +From 2e03d94682524ccc0e511e14b97364c68cd7f105 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Thu, 6 Sep 2018 10:58:11 -0400 +Subject: [PATCH] xsettings: don't complain at start up when fetching window + scale + +g-s-d tries to get the window scale from mutter at startup before +mutter is running. + +It then posts a warning to the log when it fails to talk to mutter. + +This commit circumvents the warning by tracking mutter's lifetime, +and avoiding calls into it before its running. +--- + plugins/xsettings/gsd-xsettings-manager.c | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c +index eb55b8b7..f6406a95 100644 +--- a/plugins/xsettings/gsd-xsettings-manager.c ++++ b/plugins/xsettings/gsd-xsettings-manager.c +@@ -259,60 +259,61 @@ typedef struct _FixedEntry FixedEntry; + typedef void (* FixedFunc) (GnomeXSettingsManager *manager, + FixedEntry *fixed); + typedef union { + const char *str; + int num; + } FixedEntryValue; + + struct _FixedEntry { + const char *xsetting_name; + FixedFunc func; + FixedEntryValue val; + }; + + struct GnomeXSettingsManagerPrivate + { + guint start_idle_id; + XSettingsManager *manager; + GHashTable *settings; + + GSettings *plugin_settings; + FcMonitor *fontconfig_monitor; + gint64 fontconfig_timestamp; + + GsdXSettingsGtk *gtk; + + GsdRemoteDisplayManager *remote_display; + gboolean enable_animations; + + guint display_config_watch_id; + guint monitors_changed_id; ++ gboolean have_display_config; + + guint shell_name_watch_id; + gboolean have_shell; + + guint notify_idle_id; + + GDBusNodeInfo *introspection_data; + GDBusConnection *dbus_connection; + guint gtk_settings_name_id; + }; + + #define GSD_XSETTINGS_ERROR gsd_xsettings_error_quark () + + enum { + GSD_XSETTINGS_ERROR_INIT + }; + + static void gnome_xsettings_manager_class_init (GnomeXSettingsManagerClass *klass); + static void gnome_xsettings_manager_init (GnomeXSettingsManager *xsettings_manager); + static void gnome_xsettings_manager_finalize (GObject *object); + + static void register_manager_dbus (GnomeXSettingsManager *manager); + + G_DEFINE_TYPE (GnomeXSettingsManager, gnome_xsettings_manager, G_TYPE_OBJECT) + + static gpointer manager_object = NULL; + + static GQuark + gsd_xsettings_error_quark (void) + { +@@ -601,60 +602,65 @@ is_layout_mode_logical (GVariantIter *properties) + layout_mode = layout_mode_value; + + break; + } + + return layout_mode == DISPLAY_LAYOUT_MODE_LOGICAL; + } + + #define MODE_FORMAT "(siiddada{sv})" + #define MODES_FORMAT "a" MODE_FORMAT + + #define MONITOR_SPEC_FORMAT "(ssss)" + #define MONITOR_FORMAT "(" MONITOR_SPEC_FORMAT MODES_FORMAT "a{sv})" + #define MONITORS_FORMAT "a" MONITOR_FORMAT + + #define LOGICAL_MONITOR_FORMAT "(iiduba" MONITOR_SPEC_FORMAT "a{sv})" + #define LOGICAL_MONITORS_FORMAT "a" LOGICAL_MONITOR_FORMAT + + #define CURRENT_STATE_FORMAT "(u" MONITORS_FORMAT LOGICAL_MONITORS_FORMAT "a{sv})" + + static int + get_window_scale (GnomeXSettingsManager *manager) + { + GError *error = NULL; + GVariant *current_state; + GVariantIter *logical_monitors; + GVariant *logical_monitor_variant; + GVariantIter *properties; + int scale = 1; + ++ if (!manager->priv->have_display_config) { ++ g_debug("Window scale requested when mutter isn't running, falling back to scale 1"); ++ return 1; ++ } ++ + current_state = + g_dbus_connection_call_sync (manager->priv->dbus_connection, + "org.gnome.Mutter.DisplayConfig", + "/org/gnome/Mutter/DisplayConfig", + "org.gnome.Mutter.DisplayConfig", + "GetCurrentState", + NULL, + NULL, + G_DBUS_CALL_FLAGS_NO_AUTO_START, + -1, + NULL, + &error); + if (!current_state) { + g_warning ("Failed to get current display configuration state: %s", + error->message); + g_error_free (error); + return 1; + } + + g_variant_get (current_state, + CURRENT_STATE_FORMAT, + NULL, + NULL, + &logical_monitors, + &properties); + + if (is_layout_mode_logical (properties)) + goto out; + + while (g_variant_iter_next (logical_monitors, "@"LOGICAL_MONITOR_FORMAT, +@@ -1184,103 +1190,116 @@ enable_animations_changed_cb (GSettings *settings, + force_disable_animation_changed (G_OBJECT (manager->priv->remote_display), NULL, manager); + } + + static void + monitors_changed (GnomeXSettingsManager *manager) + { + update_xft_settings (manager); + queue_notify (manager); + } + + static void + on_monitors_changed (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer data) + { + GnomeXSettingsManager *manager = data; + monitors_changed (manager); + } + + static void + on_display_config_name_appeared_handler (GDBusConnection *connection, + const gchar *name, + const gchar *name_owner, + gpointer data) + { + GnomeXSettingsManager *manager = data; ++ ++ manager->priv->have_display_config = TRUE; ++ monitors_changed (manager); ++} ++ ++static void ++on_display_config_name_disappeared_handler (GDBusConnection *connection, ++ const gchar *name, ++ gpointer data) ++{ ++ GnomeXSettingsManager *manager = data; ++ ++ manager->priv->have_display_config = FALSE; + monitors_changed (manager); + } + + gboolean + gnome_xsettings_manager_start (GnomeXSettingsManager *manager, + GError **error) + { + GVariant *overrides; + guint i; + GList *list, *l; + const char *session; + + g_debug ("Starting xsettings manager"); + gnome_settings_profile_start (NULL); + + if (!setup_xsettings_managers (manager)) { + g_set_error (error, GSD_XSETTINGS_ERROR, + GSD_XSETTINGS_ERROR_INIT, + "Could not initialize xsettings manager."); + return FALSE; + } + + manager->priv->remote_display = gsd_remote_display_manager_new (); + g_signal_connect (G_OBJECT (manager->priv->remote_display), "notify::force-disable-animations", + G_CALLBACK (force_disable_animation_changed), manager); + + manager->priv->monitors_changed_id = + g_dbus_connection_signal_subscribe (manager->priv->dbus_connection, + "org.gnome.Mutter.DisplayConfig", + "org.gnome.Mutter.DisplayConfig", + "MonitorsChanged", + "/org/gnome/Mutter/DisplayConfig", + NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + on_monitors_changed, + manager, + NULL); + manager->priv->display_config_watch_id = + g_bus_watch_name_on_connection (manager->priv->dbus_connection, + "org.gnome.Mutter.DisplayConfig", + G_BUS_NAME_WATCHER_FLAGS_NONE, + on_display_config_name_appeared_handler, +- NULL, ++ on_display_config_name_disappeared_handler, + manager, + NULL); + + manager->priv->settings = g_hash_table_new_full (g_str_hash, g_str_equal, + NULL, (GDestroyNotify) g_object_unref); + + g_hash_table_insert (manager->priv->settings, + MOUSE_SETTINGS_SCHEMA, g_settings_new (MOUSE_SETTINGS_SCHEMA)); + g_hash_table_insert (manager->priv->settings, + BACKGROUND_SETTINGS_SCHEMA, g_settings_new (BACKGROUND_SETTINGS_SCHEMA)); + g_hash_table_insert (manager->priv->settings, + INTERFACE_SETTINGS_SCHEMA, g_settings_new (INTERFACE_SETTINGS_SCHEMA)); + g_hash_table_insert (manager->priv->settings, + SOUND_SETTINGS_SCHEMA, g_settings_new (SOUND_SETTINGS_SCHEMA)); + g_hash_table_insert (manager->priv->settings, + PRIVACY_SETTINGS_SCHEMA, g_settings_new (PRIVACY_SETTINGS_SCHEMA)); + g_hash_table_insert (manager->priv->settings, + WM_SETTINGS_SCHEMA, g_settings_new (WM_SETTINGS_SCHEMA)); + g_hash_table_insert (manager->priv->settings, + A11Y_SCHEMA, g_settings_new (A11Y_SCHEMA)); + + session = g_getenv ("XDG_CURRENT_DESKTOP"); + if (session && strstr (session, "GNOME-Classic")) { + GSettingsSchema *schema; + + schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (), + CLASSIC_WM_SETTINGS_SCHEMA, FALSE); + if (schema) { + g_hash_table_insert (manager->priv->settings, + CLASSIC_WM_SETTINGS_SCHEMA, +-- +2.19.0.rc1 + diff --git a/SPECS/gnome-settings-daemon.spec b/SPECS/gnome-settings-daemon.spec index 953ff68..c03f280 100644 --- a/SPECS/gnome-settings-daemon.spec +++ b/SPECS/gnome-settings-daemon.spec @@ -8,7 +8,7 @@ Name: gnome-settings-daemon Version: 3.28.1 -Release: 5%{?dist} +Release: 8%{?dist} Summary: The daemon sharing settings from GNOME to GTK+/KDE applications License: GPLv2+ @@ -34,6 +34,12 @@ Patch50: gnome-settings-daemon-python3.patch Patch51: enable-ibus-osk-purpose.patch +Patch52: 0001-rfkill-Use-GUdev-to-monitor-rfkill-device-presence.patch + +Patch53: 0001-xsettings-don-t-complain-at-start-up-when-fetching-w.patch + +Patch54: 0001-common-Add-display-mapping-check-specific-for-the-De.patch + BuildRequires: cups-devel BuildRequires: gettext BuildRequires: meson @@ -234,6 +240,18 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_libexecdir}/gsd-test-input-helper %changelog +* Fri Sep 06 2019 Carlos Garnacho - 3.28.1-8 +- Add display mapping check specific for the Dell Canvas + Resolves: #1548320 + +* Thu Aug 08 2019 Carlos Garnacho - 3.28.1-7 +- Fallback scale properly without org.gnome.Mutter.DisplayConfig + Resolves: #1556776 + +* Wed Aug 07 2019 Carlos Garnacho - 3.28.1-6 +- Handle rfkill device disappearing + Resolves: #1691197 + * Mon Jul 22 2019 Carlos Garnacho - 3.28.1-5 - Added patch for - keyboard: Enable ibus for OSK purposes Resolves: #1632904