! 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 !
Digital clock slow to update after laptop resume
Status:
RESOLVED: FIXED
Product:
Xfce4-panel

Comments

Description jim 2011-10-31 09:57:49 CET
Running xfce4-panel-4.8.6-1.fc15.x86_64 on Fedora 15 with a digital clock displayed in the panel, default %R time format (i.e. HH:MM format).  When I resume my laptop after suspend, the panel clock displays the wrong time (i.e. the system time when I previously suspended) and does not update for up to a minute.

I think this is because when the clock does not display seconds, its logic requests a glib timeout approximately every 60 seconds, regardless of whether there was a suspend in the previous minute or not.  One hack would be to always request a glib timeout every second, regardless of whether seconds are being displayed or not -- this minimises the window where the wrong time is displayed.  Alternatively, somehow detecting a resume and automatically updating the clock as a one-off event immediately afterwards could be a "neater" solution although perhaps significantly harder to do.
Comment 1 Nick Schermer editbugs 2011-10-31 10:30:30 CET
Indeed, the timeout first syncs to the real time and then only updates when required to save power. We could monitor the d-bus suspend/hibernate event, but we're overhauling that atm in master.

Not very high prio for me.
Comment 2 Nick Schermer editbugs 2011-10-31 11:31:47 CET
Signal could be send by xfce4-power-manager (currently only a method, but it is easy to add a signal for power events too). Interface name is org.xfce.Power.Manager.
Comment 3 Mike Massonnet editbugs 2011-10-31 17:03:26 CET
This bug happens also when you change the clock with the command 'date' for example :/
Comment 4 Nick Schermer editbugs 2011-11-01 09:18:53 CET
That something we cannot detect that easily. But how often do you adjust the system time, ntp does that for you ;-).
Comment 5 Mike Massonnet editbugs 2011-12-03 10:32:52 CET
perhaps the plugin could update the clock in two different conditions:
- on battery -> update the clock as less as possible depending on the format
- on AC -> lookup the time every second
Comment 6 Mike Massonnet editbugs 2011-12-03 10:33:57 CET
PS: default should be to update as less as possible, in case it's impossible to guess if power usage is on battery or AC
Comment 7 Nick Schermer editbugs 2011-12-03 18:33:51 CET
Pushed a branch to use realtime posix timers, these should work properly after suspend. Can someone give it a shot?

http://git.xfce.org/xfce/xfce4-panel/commit/?h=nick/clockrealtime
Comment 8 Nick Schermer editbugs 2011-12-11 23:17:03 CET
Tested by Mike as well and it resolves the suspend problems and also time updates (ntpdate) from time to time ;-).

Bug #8090

Reported by:
jim
Reported on: 2011-10-31
Last modified on: 2011-12-11

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Attachments

Additional information