From 763dc34f27682cd6c3ecbe253aa75475391d4056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emel=20=C3=96zt=C3=BCrk?= Date: Thu, 10 Sep 2026 11:38:53 +0300 Subject: [PATCH] cs_nightlight: update schedule spinners when settings change externally The two time spinners only read the schedule keys once when the page is built, so if something changes them from outside (gsettings, another app) the spinners kept showing the old values until you reopened the window. The other widgets on the page already update live Listen for changes on both keys and update the spinners --- .../cinnamon-settings/modules/cs_nightlight.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/files/usr/share/cinnamon/cinnamon-settings/modules/cs_nightlight.py b/files/usr/share/cinnamon/cinnamon-settings/modules/cs_nightlight.py index d4ef890d34..1addfeb2c8 100644 --- a/files/usr/share/cinnamon/cinnamon-settings/modules/cs_nightlight.py +++ b/files/usr/share/cinnamon/cinnamon-settings/modules/cs_nightlight.py @@ -171,6 +171,9 @@ def __init__(self, size_group): adjust.connect("value-changed", self.to_spinner_values_changed, self.end_hr) self.content_widget.pack_start(self.end_hr, True, True, 0) + self.color_settings.connect("changed::night-light-schedule-from", self.on_settings_changed, self.start_hr) + self.color_settings.connect("changed::night-light-schedule-to", self.on_settings_changed, self.end_hr) + self.show_all() def from_spinner_values_changed(self, adjustment, spinner): @@ -178,3 +181,11 @@ def from_spinner_values_changed(self, adjustment, spinner): def to_spinner_values_changed(self, adjustment, spinner): self.color_settings.set_double("night-light-schedule-to", spinner.get_time_fraction()) + + def on_settings_changed(self, settings, key, spinner): + value = settings.get_double(key) + adjustment = spinner.get_adjustment() + # Skip when the change originated from this spinner to avoid a feedback loop + if adjustment.get_value() == value: + return + adjustment.set_value(value)