From 2b8237984595fdbdc2d8cc18fb816ed60c024206cb1c76a5b636f6f1e2b08ac7 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Wed, 10 Apr 2024 15:40:34 +0000 Subject: [PATCH] Accepting request 1166530 from home:xiaoguang_wang:branches:GNOME:Factory - Add gnome-control-center-datetime-Avoid-emitting-the-time-changed-signal.patch: Avoid emitting the time-changed signal (bsc#1222149, bsc#1221799, glgo#GNOME/gnome-control-center#2943). OBS-URL: https://build.opensuse.org/request/show/1166530 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-control-center?expand=0&rev=548 --- ...oid-emitting-the-time-changed-signal.patch | 77 +++++++++++++++++++ gnome-control-center.changes | 7 ++ gnome-control-center.spec | 3 + 3 files changed, 87 insertions(+) create mode 100644 gnome-control-center-datetime-Avoid-emitting-the-time-changed-signal.patch diff --git a/gnome-control-center-datetime-Avoid-emitting-the-time-changed-signal.patch b/gnome-control-center-datetime-Avoid-emitting-the-time-changed-signal.patch new file mode 100644 index 0000000..d31a550 --- /dev/null +++ b/gnome-control-center-datetime-Avoid-emitting-the-time-changed-signal.patch @@ -0,0 +1,77 @@ +From 535404bba267c7c542ed68641e309665171b29ff Mon Sep 17 00:00:00 2001 +From: Xiaoguang Wang +Date: Wed, 3 Apr 2024 12:46:24 +0800 +Subject: [PATCH] datetime: Avoid emitting the time-changed signal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When setting the widget value, don’t emit the time-changed signal. + +Fixes #2943 +--- + panels/system/datetime/cc-datetime-page.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/panels/system/datetime/cc-datetime-page.c b/panels/system/datetime/cc-datetime-page.c +index c20960506..25dac113c 100644 +--- a/panels/system/datetime/cc-datetime-page.c ++++ b/panels/system/datetime/cc-datetime-page.c +@@ -206,6 +206,10 @@ clock_settings_changed_cb (CcDateTimePage *self, + g_signal_handlers_unblock_by_func (self->ampm_format_button, change_clock_settings, self); + } + ++static void on_month_selection_changed_cb (CcDateTimePage *self); ++ ++static void time_changed_cb (CcDateTimePage *self, ++ CcTimeEditor *editor); + + /* Update the widgets based on the system time */ + static void +@@ -219,9 +223,11 @@ update_time (CcDateTimePage *self) + else + use_ampm = FALSE; + ++ g_signal_handlers_block_by_func (self->time_editor, time_changed_cb, self); + cc_time_editor_set_time (self->time_editor, + g_date_time_get_hour (self->date), + g_date_time_get_minute (self->date)); ++ g_signal_handlers_unblock_by_func (self->time_editor, time_changed_cb, self); + + /* Update the time on the listbow row */ + if (use_ampm) +@@ -236,7 +242,9 @@ update_time (CcDateTimePage *self) + } + + self->month = g_date_time_get_month (self->date); ++ g_signal_handlers_block_by_func (self->month_model, on_month_selection_changed_cb, self); + gtk_single_selection_set_selected (self->month_model, self->month - 1); ++ g_signal_handlers_unblock_by_func (self->month_model, on_month_selection_changed_cb, self); + cc_list_row_set_secondary_label (self->datetime_row, label); + } + +@@ -362,9 +370,11 @@ change_date (CcDateTimePage *self) + g_date_time_get_hour (old_date), + g_date_time_get_minute (old_date), + g_date_time_get_second (old_date)); ++ g_signal_handlers_block_by_func (self->time_editor, time_changed_cb, self); + cc_time_editor_set_time (self->time_editor, + g_date_time_get_hour (self->date), + g_date_time_get_minute (self->date)); ++ g_signal_handlers_unblock_by_func (self->time_editor, time_changed_cb, self); + + queue_set_datetime (self); + } +@@ -741,7 +751,9 @@ setup_datetime_dialog (CcDateTimePage *self) + + /* Month */ + self->month = g_date_time_get_month (self->date); ++ g_signal_handlers_block_by_func (self->month_model, on_month_selection_changed_cb, self); + gtk_single_selection_set_selected (self->month_model, self->month - 1); ++ g_signal_handlers_unblock_by_func (self->month_model, on_month_selection_changed_cb, self); + } + + static int +-- +2.44.0 + diff --git a/gnome-control-center.changes b/gnome-control-center.changes index b6a4ea8..62afc4c 100644 --- a/gnome-control-center.changes +++ b/gnome-control-center.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 8 03:14:11 UTC 2024 - Xiaoguang Wang + +- Add gnome-control-center-datetime-Avoid-emitting-the-time-changed-signal.patch: + Avoid emitting the time-changed signal + (bsc#1222149, bsc#1221799, glgo#GNOME/gnome-control-center#2943). + ------------------------------------------------------------------- Wed Mar 27 18:23:40 UTC 2024 - Dominique Leuenberger diff --git a/gnome-control-center.spec b/gnome-control-center.spec index 8b9399e..5d31a47 100644 --- a/gnome-control-center.spec +++ b/gnome-control-center.spec @@ -37,6 +37,8 @@ Source99: %{name}-rpmlintrc # PATCH-FIX-OPENSUSE gnome-control-center-disable-error-message-for-NM.patch bsc#989801 sckang@suse.com -- network: Improve the check for whether NM or wicked is running Patch1: gnome-control-center-disable-error-message-for-NM.patch +# PATCH-FIX-UPSTREAM gnome-control-center-datetime-Avoid-emitting-the-time-changed-signal.patch bsc#1222149 glgo#GNOME/gnome-control-center#2943 xwang@suse.com -- Avoid emitting the time-changed signal +Patch2: gnome-control-center-datetime-Avoid-emitting-the-time-changed-signal.patch ### patches for Leap >= 15 plus SLE >= 15, but not TW # PATCH-FEATURE-SLE gnome-control-center-info-never-use-gnome-software.patch bsc#999336 fezhang@suse.com -- info: Never search for gnome-software as an option when checking for updates on SLE and Leap 42.2, because we use gpk-update-viewer. @@ -195,6 +197,7 @@ GNOME control center. %prep %setup -q %patch -P 1 -p1 +%patch -P 2 -p1 # patches for Leap >= 15 plus SLE >= 15, but not TW %if 0%{?sle_version} >= 150000