Bug 509141

Summary: With knighttime KCM configured in manual times mode, automatic light/dark global theme switcher did not notice time zone change that made it night time
Product: [Applications] systemsettings Reporter: Nate Graham <nate>
Component: Quick SettingsAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdedev, vlad.zahorodnii
Priority: NOR    
Version First Reported In: 6.4.80   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nate Graham 2025-09-05 09:55:41 UTC
STEPS TO REPRODUCE
1. Select a time zone in System Settings > Date & Time > Time Zone that makes the current time be during the day
2. Enable automatic day/night switching in System Settings > Quick Settings
3. Change the time zone to a location that makes the current time be night


OBSERVED RESULT
The switch-over to night mode doesn't happen


EXPECTED RESULT
The switch-over to night mode happens after the selected inactivity timeout (5 seconds by default)


ADDITIONAL INFORMATION
Restarting kded makes it notice the time zone change, and then it switches after 5 seconds.


SOFTWARE/OS VERSIONS
Operating System: KDE Linux 2025-09-03
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.16.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon™ 780M Graphics
Memory: 16 GiB of RAM (14.9 GiB usable)
Graphics Processor: AMD Radeon 780M Graphics
Comment 1 Vlad Zahorodnii 2025-09-15 21:41:52 UTC
Did the location change too?
Comment 2 Nate Graham 2025-09-17 17:00:05 UTC
I forgot to mention that I had the KCM configured with manual times mode, not location mode.

What's interesting is that Night Light activated properly after I changed the time zone, but the automatic light-dark switcher didn't. So I guess the KCM isn't to blame here.
Comment 3 Vlad Zahorodnii 2025-09-18 10:29:47 UTC
Huh, I'm still confused why night light would react to the new time zone.
Comment 4 Vlad Zahorodnii 2025-09-18 10:31:43 UTC
For me, neither reacts to new timezone.
Comment 5 Nate Graham 2025-09-18 14:21:33 UTC
In manual times mode, knighttime-based changes are based on the time of day rather than the location. Changing the time zone changes the time of day.
Comment 6 Vlad Zahorodnii 2025-09-18 14:45:15 UTC
(In reply to Nate Graham from comment #5)
> In manual times mode, knighttime-based changes are based on the time of day
> rather than the location. Changing the time zone changes the time of day.

We might be talking passed each other.

First, there is an issue of night light and automatic theme switching reacting to timezone changes.

Second, there is an issue of reacting to new timezone in the KCM(s).

I am talking about the first one. I can see why it doesn't work, because the utc time doesn't change when you change the timezone. And I'm confused why night light respects new time zone on your machine, I'd expect that both night light and automatic theme switching don't account for the new timezone until a reboot.
Comment 7 Vlad Zahorodnii 2025-09-19 10:48:44 UTC
https://invent.kde.org/plasma/knighttime/-/commits/work/zzag/time-zone makes knighttime react to timezone changes, but to be frank, I am not a huge fan of it because it increases the size of dbus payloads quite significantly.

This is a real issue, but it's also something that'll affect only a handful of people. Maybe both the client and the daemon side can be changed to use the system time zone instead of Qt::LocalTime without adding more data to dbus payloads. Not sure, I'll need to think more about it.