From 0a6c47fd10c0d154ac2811f6c6857f514f9d1ee0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 15 2022 06:46:46 +0000 Subject: import gnome-control-center-40.0-27.el9 --- diff --git a/SOURCES/change-device-name-with-enter-key.patch b/SOURCES/change-device-name-with-enter-key.patch new file mode 100644 index 0000000..edc8eaa --- /dev/null +++ b/SOURCES/change-device-name-with-enter-key.patch @@ -0,0 +1,81 @@ +From 8eab500540c1631dbdc760bca617a581e2969ed6 Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Mon, 1 Aug 2022 10:57:07 +0200 +Subject: [PATCH] info-overview: Allow changing "Device Name" by pressing + "Enter" + +The hostname/device name dialog has only a GtkEntry. So a user +navigating with only a keyboard should be able to apply their +changes by pressing "Enter". +--- + panels/info-overview/cc-info-overview-panel.c | 34 +++++++++++++++++++ + .../info-overview/cc-info-overview-panel.ui | 1 + + 2 files changed, 35 insertions(+) + +diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c +index a2cb70755..e8881d70d 100644 +--- a/panels/info-overview/cc-info-overview-panel.c ++++ b/panels/info-overview/cc-info-overview-panel.c +@@ -818,6 +818,38 @@ on_device_name_entry_changed (CcInfoOverviewPanel *self) + g_strcmp0 (current_hostname, new_hostname) != 0); + } + ++static void ++update_device_name (CcInfoOverviewPanel *self) ++{ ++ const gchar *hostname; ++ ++ /* We simply change the CcHostnameEntry text. CcHostnameEntry ++ * listens to changes and updates hostname on change. ++ */ ++ hostname = gtk_entry_get_text (GTK_ENTRY (self->device_name_entry)); ++ gtk_entry_set_text (GTK_ENTRY (self->hostname_entry), hostname); ++} ++ ++static void ++on_hostname_editor_dialog_response_cb (GtkDialog *dialog, ++ gint response, ++ CcInfoOverviewPanel *self) ++{ ++ if (response == GTK_RESPONSE_APPLY) ++ { ++ update_device_name (self); ++ } ++ ++ gtk_window_close (GTK_WINDOW (dialog)); ++} ++ ++static void ++on_device_name_entry_activated_cb (CcInfoOverviewPanel *self) ++{ ++ update_device_name (self); ++ gtk_window_close (GTK_WINDOW (self->hostname_editor)); ++} ++ + static void + open_hostname_edit_dialog (CcInfoOverviewPanel *self) + { +@@ -906,6 +938,8 @@ cc_info_overview_panel_class_init (CcInfoOverviewPanelClass *klass) + + gtk_widget_class_bind_template_callback (widget_class, cc_info_panel_row_activated_cb); + gtk_widget_class_bind_template_callback (widget_class, on_device_name_entry_changed); ++ gtk_widget_class_bind_template_callback (widget_class, on_device_name_entry_activated_cb); ++ gtk_widget_class_bind_template_callback (widget_class, on_hostname_editor_dialog_response_cb); + + g_type_ensure (CC_TYPE_LIST_ROW); + g_type_ensure (CC_TYPE_HOSTNAME_ENTRY); +diff --git a/panels/info-overview/cc-info-overview-panel.ui b/panels/info-overview/cc-info-overview-panel.ui +index 2f5d3cf8b..adf3b5409 100644 +--- a/panels/info-overview/cc-info-overview-panel.ui ++++ b/panels/info-overview/cc-info-overview-panel.ui +@@ -219,6 +219,7 @@ + + True + ++ + + + +-- +2.34.1 + diff --git a/SOURCES/display-infobar-if-night-light-unsupported.patch b/SOURCES/display-infobar-if-night-light-unsupported.patch new file mode 100644 index 0000000..62a3e2b --- /dev/null +++ b/SOURCES/display-infobar-if-night-light-unsupported.patch @@ -0,0 +1,416 @@ +From c999bade4d27e0384b6495ee3bbf88df1b9e256b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Thu, 24 Feb 2022 12:30:23 +0100 +Subject: [PATCH 1/2] display: Add 'NightLightSupported' property support + +--- + panels/display/cc-display-config-manager-dbus.c | 17 +++++++++++++++++ + panels/display/cc-display-config-manager.c | 6 ++++++ + panels/display/cc-display-config-manager.h | 3 +++ + 3 files changed, 26 insertions(+) + +diff --git a/panels/display/cc-display-config-manager-dbus.c b/panels/display/cc-display-config-manager-dbus.c +index 392140101..678b696db 100644 +--- a/panels/display/cc-display-config-manager-dbus.c ++++ b/panels/display/cc-display-config-manager-dbus.c +@@ -33,6 +33,7 @@ struct _CcDisplayConfigManagerDBus + GVariant *current_state; + + gboolean apply_allowed; ++ gboolean night_light_supported; + }; + + G_DEFINE_TYPE (CcDisplayConfigManagerDBus, +@@ -169,6 +170,12 @@ bus_gotten (GObject *object, + else + g_warning ("Missing property 'ApplyMonitorsConfigAllowed' on DisplayConfig API"); + ++ variant = g_dbus_proxy_get_cached_property (proxy, "NightLightSupported"); ++ if (variant) ++ self->night_light_supported = g_variant_get_boolean (variant); ++ else ++ g_warning ("Missing property 'NightLightSupported' on DisplayConfig API"); ++ + get_current_state (self); + } + +@@ -176,6 +183,7 @@ static void + cc_display_config_manager_dbus_init (CcDisplayConfigManagerDBus *self) + { + self->apply_allowed = TRUE; ++ self->night_light_supported = TRUE; + self->cancellable = g_cancellable_new (); + g_bus_get (G_BUS_TYPE_SESSION, self->cancellable, bus_gotten, self); + } +@@ -205,6 +213,14 @@ cc_display_config_manager_dbus_get_apply_allowed (CcDisplayConfigManager *pself) + return self->apply_allowed; + } + ++static gboolean ++cc_display_config_manager_dbus_get_night_light_supported (CcDisplayConfigManager *pself) ++{ ++ CcDisplayConfigManagerDBus *self = CC_DISPLAY_CONFIG_MANAGER_DBUS (pself); ++ ++ return self->night_light_supported; ++} ++ + static void + cc_display_config_manager_dbus_class_init (CcDisplayConfigManagerDBusClass *klass) + { +@@ -215,6 +231,7 @@ cc_display_config_manager_dbus_class_init (CcDisplayConfigManagerDBusClass *klas + + parent_class->get_current = cc_display_config_manager_dbus_get_current; + parent_class->get_apply_allowed = cc_display_config_manager_dbus_get_apply_allowed; ++ parent_class->get_night_light_supported = cc_display_config_manager_dbus_get_night_light_supported; + } + + CcDisplayConfigManager * +diff --git a/panels/display/cc-display-config-manager.c b/panels/display/cc-display-config-manager.c +index 3d683c53d..f231edd69 100644 +--- a/panels/display/cc-display-config-manager.c ++++ b/panels/display/cc-display-config-manager.c +@@ -65,3 +65,9 @@ cc_display_config_manager_get_apply_allowed (CcDisplayConfigManager *self) + { + return CC_DISPLAY_CONFIG_MANAGER_GET_CLASS (self)->get_apply_allowed (self); + } ++ ++gboolean ++cc_display_config_manager_get_night_light_supported (CcDisplayConfigManager *self) ++{ ++ return CC_DISPLAY_CONFIG_MANAGER_GET_CLASS (self)->get_night_light_supported (self); ++} +diff --git a/panels/display/cc-display-config-manager.h b/panels/display/cc-display-config-manager.h +index 64f0775e9..ab1e84f85 100644 +--- a/panels/display/cc-display-config-manager.h ++++ b/panels/display/cc-display-config-manager.h +@@ -35,12 +35,15 @@ struct _CcDisplayConfigManagerClass + + CcDisplayConfig * (*get_current) (CcDisplayConfigManager *self); + gboolean (* get_apply_allowed) (CcDisplayConfigManager *self); ++ gboolean (* get_night_light_supported) (CcDisplayConfigManager *self); + }; + + CcDisplayConfig * cc_display_config_manager_get_current (CcDisplayConfigManager *self); + + gboolean cc_display_config_manager_get_apply_allowed (CcDisplayConfigManager *self); + ++gboolean cc_display_config_manager_get_night_light_supported (CcDisplayConfigManager *self); ++ + void _cc_display_config_manager_emit_changed (CcDisplayConfigManager *self); + + G_END_DECLS +-- +2.34.1 + + +From 414e23272f89198efc452a4f8d50442c72a07956 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Thu, 24 Feb 2022 12:31:00 +0100 +Subject: [PATCH 2/2] display: Show infobar if night light isn't supported + +This may be the case on e.g. fully remote / headless sessions, or as of +now, when using the NVIDIA driver to run a Wayland session. + +Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1659 +--- + panels/display/cc-night-light-page.c | 153 +++++++++++++++----------- + panels/display/cc-night-light-page.ui | 41 ++++++- + 2 files changed, 129 insertions(+), 65 deletions(-) + +diff --git a/panels/display/cc-night-light-page.c b/panels/display/cc-night-light-page.c +index f51b0ba69..482b90fea 100644 +--- a/panels/display/cc-night-light-page.c ++++ b/panels/display/cc-night-light-page.c +@@ -29,15 +29,18 @@ + #include "list-box-helper.h" + + #include "shell/cc-object-storage.h" ++#include "cc-display-config-manager-dbus.h" + + struct _CcNightLightPage { + GtkBin parent; + ++ GtkWidget *night_light_settings; + GtkWidget *box_manual; + GtkButton *button_from_am; + GtkButton *button_from_pm; + GtkButton *button_to_am; + GtkButton *button_to_pm; ++ GtkWidget *infobar_unsupported; + GtkWidget *infobar_disabled; + GtkListBox *listbox; + GtkWidget *scale_color_temperature; +@@ -64,6 +67,8 @@ struct _CcNightLightPage { + gboolean ignore_value_changed; + guint timer_id; + GDesktopClockFormat clock_format; ++ ++ CcDisplayConfigManager *config_manager; + }; + + G_DEFINE_TYPE (CcNightLightPage, cc_night_light_page, GTK_TYPE_BIN); +@@ -122,88 +127,97 @@ dialog_adjustments_set_frac_hours (CcNightLightPage *self, + static void + dialog_update_state (CcNightLightPage *self) + { +- gboolean automatic; +- gboolean disabled_until_tomorrow = FALSE; +- gboolean enabled; +- gdouble value = 0.f; +- +- /* only show the infobar if we are disabled */ +- if (self->proxy_color != NULL) ++ if (cc_display_config_manager_get_night_light_supported (self->config_manager)) + { +- g_autoptr(GVariant) disabled = NULL; +- disabled = g_dbus_proxy_get_cached_property (self->proxy_color, +- "DisabledUntilTomorrow"); +- if (disabled != NULL) +- disabled_until_tomorrow = g_variant_get_boolean (disabled); +- } +- gtk_widget_set_visible (self->infobar_disabled, disabled_until_tomorrow); ++ gboolean automatic; ++ gboolean disabled_until_tomorrow = FALSE; ++ gboolean enabled; ++ gdouble value = 0.f; + +- /* make things insensitive if the switch is disabled */ +- enabled = g_settings_get_boolean (self->settings_display, "night-light-enabled"); +- automatic = g_settings_get_boolean (self->settings_display, "night-light-schedule-automatic"); ++ /* only show the infobar if we are disabled */ ++ if (self->proxy_color != NULL) ++ { ++ g_autoptr(GVariant) disabled = NULL; ++ disabled = g_dbus_proxy_get_cached_property (self->proxy_color, ++ "DisabledUntilTomorrow"); ++ if (disabled != NULL) ++ disabled_until_tomorrow = g_variant_get_boolean (disabled); ++ } ++ gtk_widget_set_visible (self->infobar_disabled, disabled_until_tomorrow); + +- gtk_widget_set_sensitive (self->box_manual, enabled && !automatic); ++ /* make things insensitive if the switch is disabled */ ++ enabled = g_settings_get_boolean (self->settings_display, "night-light-enabled"); ++ automatic = g_settings_get_boolean (self->settings_display, "night-light-schedule-automatic"); + +- gtk_combo_box_set_active_id (self->schedule_type_combo, automatic ? "automatic" : "manual"); ++ gtk_widget_set_sensitive (self->box_manual, enabled && !automatic); + +- /* set from */ +- if (automatic && self->proxy_color != NULL) +- { +- g_autoptr(GVariant) sunset = NULL; +- sunset = g_dbus_proxy_get_cached_property (self->proxy_color, "Sunset"); +- if (sunset != NULL) ++ gtk_combo_box_set_active_id (self->schedule_type_combo, automatic ? "automatic" : "manual"); ++ ++ /* set from */ ++ if (automatic && self->proxy_color != NULL) + { +- value = g_variant_get_double (sunset); ++ g_autoptr(GVariant) sunset = NULL; ++ sunset = g_dbus_proxy_get_cached_property (self->proxy_color, "Sunset"); ++ if (sunset != NULL) ++ { ++ value = g_variant_get_double (sunset); ++ } ++ else ++ { ++ value = 16.0f; ++ g_warning ("no sunset data, using %02.2f", value); ++ } + } + else + { +- value = 16.0f; +- g_warning ("no sunset data, using %02.2f", value); ++ value = g_settings_get_double (self->settings_display, "night-light-schedule-from"); ++ value = fmod (value, 24.f); + } +- } +- else +- { +- value = g_settings_get_double (self->settings_display, "night-light-schedule-from"); +- value = fmod (value, 24.f); +- } +- dialog_adjustments_set_frac_hours (self, value, +- self->adjustment_from_hours, +- self->adjustment_from_minutes, +- self->stack_from, +- self->button_from_am, +- self->button_from_pm); +- +- /* set to */ +- if (automatic && self->proxy_color != NULL) +- { +- g_autoptr(GVariant) sunset = NULL; +- sunset = g_dbus_proxy_get_cached_property (self->proxy_color, "Sunrise"); +- if (sunset != NULL) ++ dialog_adjustments_set_frac_hours (self, value, ++ self->adjustment_from_hours, ++ self->adjustment_from_minutes, ++ self->stack_from, ++ self->button_from_am, ++ self->button_from_pm); ++ ++ /* set to */ ++ if (automatic && self->proxy_color != NULL) + { +- value = g_variant_get_double (sunset); ++ g_autoptr(GVariant) sunset = NULL; ++ sunset = g_dbus_proxy_get_cached_property (self->proxy_color, "Sunrise"); ++ if (sunset != NULL) ++ { ++ value = g_variant_get_double (sunset); ++ } ++ else ++ { ++ value = 8.0f; ++ g_warning ("no sunrise data, using %02.2f", value); ++ } + } + else + { +- value = 8.0f; +- g_warning ("no sunrise data, using %02.2f", value); ++ value = g_settings_get_double (self->settings_display, "night-light-schedule-to"); ++ value = fmod (value, 24.f); + } ++ dialog_adjustments_set_frac_hours (self, value, ++ self->adjustment_to_hours, ++ self->adjustment_to_minutes, ++ self->stack_to, ++ self->button_to_am, ++ self->button_to_pm); ++ ++ self->ignore_value_changed = TRUE; ++ value = (gdouble) g_settings_get_uint (self->settings_display, "night-light-temperature"); ++ gtk_adjustment_set_value (self->adjustment_color_temperature, value); ++ self->ignore_value_changed = FALSE; + } + else + { +- value = g_settings_get_double (self->settings_display, "night-light-schedule-to"); +- value = fmod (value, 24.f); ++ gtk_widget_set_visible (self->infobar_unsupported, TRUE); ++ gtk_widget_set_visible (self->infobar_disabled, FALSE); ++ gtk_widget_set_sensitive (self->night_light_settings, FALSE); + } +- dialog_adjustments_set_frac_hours (self, value, +- self->adjustment_to_hours, +- self->adjustment_to_minutes, +- self->stack_to, +- self->button_to_am, +- self->button_to_pm); +- +- self->ignore_value_changed = TRUE; +- value = (gdouble) g_settings_get_uint (self->settings_display, "night-light-temperature"); +- gtk_adjustment_set_value (self->adjustment_color_temperature, value); +- self->ignore_value_changed = FALSE; + } + + static void +@@ -549,6 +563,13 @@ dialog_am_pm_to_button_clicked_cb (GtkButton *button, + g_debug ("new value = %.3f", value); + } + ++static void ++config_manager_changed_cb (CcDisplayConfigManager *config_manager, ++ CcNightLightPage *self) ++{ ++ dialog_update_state (self); ++} ++ + /* GObject overrides */ + static void + cc_night_light_page_finalize (GObject *object) +@@ -583,11 +604,13 @@ cc_night_light_page_class_init (CcNightLightPageClass *klass) + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, adjustment_to_hours); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, adjustment_to_minutes); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, adjustment_color_temperature); ++ gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, night_light_settings); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, box_manual); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, button_from_am); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, button_from_pm); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, button_to_am); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, button_to_pm); ++ gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, infobar_unsupported); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, infobar_disabled); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, listbox); + gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, night_light_toggle_switch); +@@ -700,6 +723,10 @@ cc_night_light_page_init (CcNightLightPage *self) + G_CALLBACK (dialog_clock_settings_changed_cb), + self, G_CONNECT_SWAPPED); + ++ self->config_manager = cc_display_config_manager_dbus_new (); ++ g_signal_connect (self->config_manager, "changed", ++ G_CALLBACK (config_manager_changed_cb), self); ++ + dialog_update_state (self); + } + +diff --git a/panels/display/cc-night-light-page.ui b/panels/display/cc-night-light-page.ui +index 02b14f731..cb18837ad 100644 +--- a/panels/display/cc-night-light-page.ui ++++ b/panels/display/cc-night-light-page.ui +@@ -6,9 +6,45 @@ + + True + False +- center + start + vertical ++ ++ ++ False ++ infobar_unsupported ++ warning ++ ++ ++ True ++ vertical ++ True ++ 16 ++ ++ ++ True ++ start ++ 6 ++ False ++ Night Light unavailable ++ ++ ++ ++ ++ ++ ++ ++ True ++ start ++ 6 ++ False ++ This could be the result of the graphics driver being used, or the desktop being used remotely ++ ++ ++ ++ ++ ++ ++ + + + infobar_disabled +@@ -70,8 +106,9 @@ + + + +- ++ + True ++ center + False + 30 + 12 +-- +2.34.1 + diff --git a/SPECS/gnome-control-center.spec b/SPECS/gnome-control-center.spec index 5d7e10b..da88708 100644 --- a/SPECS/gnome-control-center.spec +++ b/SPECS/gnome-control-center.spec @@ -14,7 +14,7 @@ Name: gnome-control-center Version: 40.0 -Release: 23%{?dist}.1 +Release: 27%{?dist} Summary: Utilities to configure the GNOME desktop License: GPLv2+ and CC-BY-SA @@ -43,6 +43,10 @@ Patch9: 0001-network-Fix-OWE-settings.patch # https://bugzilla.redhat.com/show_bug.cgi?id=2097838 Patch10: gnome-control-center-timezones.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2061182 +Patch11: change-device-name-with-enter-key.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2057154 +Patch12: display-infobar-if-night-light-unsupported.patch BuildRequires: chrpath BuildRequires: cups-devel @@ -233,14 +237,26 @@ chrpath --delete $RPM_BUILD_ROOT%{_bindir}/gnome-control-center %dir %{_datadir}/gnome/wm-properties %changelog -* Wed Jun 22 2022 Tomas Popela - 40.0-23.1 -- Remove timezone boundaries -- Resolves: rhbz#2099773 +* Mon Aug 01 2022 Felipe Borges - 40.0-27 +- Show infobar if night light isn't supported + Resolves: rhbz#2057154 + +* Mon Aug 01 2022 Felipe Borges - 40.0-26 +- Allow changing "Device Name" by pressing "Enter" + Resolves: rhbz#2061182 -* Mon Mar 14 2022 Felipe Borges - 40.0-23 +* Fri Jul 09 2022 Felipe Borges - 40.0-25 - Backport translations for Multitasking panel - Make Multitasking panel capable of handling Right-to-Left locales - Resolves: #2049524 + Resolves: #2105228 + +* Wed Jun 22 2022 Tomas Popela - 40.0-24 +- Bump the release to fix upgrades +- Related: rhbz#2097838 + +* Wed Jun 22 2022 Tomas Popela - 40.0-23 +- Remove timezone boundaries +- Resolves: rhbz#2097838 * Thu Feb 24 2022 Benjamin Berg - 40.0-22 - Work around libnma not handling OWE