! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
clock-plugin doesn't reflect system TZ changes
Status:
CLOSED: FIXED
Component:
clock-plugin

Comments

Description Lionel Le Folgoc 2011-02-03 16:39:28 CET
Created attachment 3457 
Proposed patch

Hi,

When I change the TZ system-wide (with sudo dpkg-reconfigure tzdata on Ubuntu/Debian for instance), orage's panel plugin (not sure if it happens in orage also) doesn't pick the new time, it stays late/early of a few hours.

A (quick'n'dirty?) fix I found is to call oc_timezone_set() before reading the time, see attached patch. Maybe calling tzset() alone is enough, I didn't check...

Thanks!
Comment 1 juha editbugs 2011-02-03 20:29:56 CET
Calling tzset should be enough as local environment stays the same.

This is a very seldom change though, so I am not sure it is worth fixing as the oc_get_time is the heart of the plugin and all code in it is problem. I will try to test this.
Comment 2 juha editbugs 2011-02-06 16:30:19 CET
Fixed in 8.6.0.7 in git.

I did not put the check in the main loop because tzset is heavy and would have made the plugin to use double amount of CPU compared to now.

I added it to two places so that now timezone is refreshed when either 
1) button is pressed on panel plugin (=orage or globaltime is hidden/made visible)
2) parameter screen is visited
3) panel is restarted.

This is not perfect, but as the timezone is very seldom changed I did not want to use CPU for that in the main loop. Your fix is valid though.
Comment 3 juha editbugs 2011-05-31 22:39:39 CEST
Fixed in 4.8.1

Bug #7232

Reported by:
Lionel Le Folgoc
Reported on: 2011-02-03
Last modified on: 2011-05-31

People

CC List:
0 users

Version

Attachments

Proposed patch (458 bytes, patch)
2011-02-03 16:39 CET , Lionel Le Folgoc
no flags

Additional information