Resuming from suspend should trigger a time update

Bug #726053 reported by Stéphane Graber on 2011-02-27
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Indicator Date and Time
Fix Released
Low
Karl Lattimer
Unity Foundations
Low
Karl Lattimer
indicator-datetime (Ubuntu)
Low
Karl Lattimer

Bug Description

When resuming from suspend this morning, I had to wait a few seconds (a minute ?) before the time updated to the current one.

indicator-datetime should automatically update the time whenever a machine comes back from suspend in order to avoid that.
I don't remember seeing this issue with gnome's clock applet so they probably found a way of doing it.

Related branches

Architecture: i386
DistroRelease: Ubuntu 11.04
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha i386 (20110202.1)
Package: indicator-datetime 0.1.96-0ubuntu1
PackageArchitecture: i386
ProcEnviron:
 LANGUAGE=en_NZ:en
 LANG=en_NZ.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.38-6.34-generic 2.6.38-rc7
Tags: natty running-unity
Uname: Linux 2.6.38-6-generic i686
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Changed in indicator-datetime (Ubuntu):
status: New → Confirmed
tags: added: apport-collected natty running-unity

apport information

Changed in indicator-datetime (Ubuntu):
importance: Undecided → Low
Changed in indicator-datetime:
importance: Undecided → Low
David Barth (dbarth) on 2011-03-28
Changed in indicator-datetime:
assignee: nobody → Karl Lattimer (karl-qdh)
Changed in indicator-datetime (Ubuntu):
assignee: nobody → Karl Lattimer (karl-qdh)
Changed in unity-foundations:
assignee: nobody → Karl Lattimer (karl-qdh)
importance: Undecided → Low
status: New → Triaged
milestone: none → unity-3.8.0-beta
Karl Lattimer (karl-qdh) wrote :

I'll see if I can find out how gnome-panel deals with this particular issue, I hope it doesn't require a whole heap of new dependencies :/

Karl Lattimer (karl-qdh) wrote :

It doesn't seem there's anything particularly special the clock applet or the gnome-panel does on suspend/resume which causes the clock to remain updated.

There's a possibility that the gnome panel is triggering on an event that I'm yet to discover.

Karl Lattimer (karl-qdh) on 2011-03-29
Changed in indicator-datetime:
status: New → In Progress
Changed in unity-foundations:
status: Triaged → In Progress
Changed in indicator-datetime (Ubuntu):
status: Confirmed → In Progress
Karl Lattimer (karl-qdh) wrote :

After some discussion it's been determined that gnome panel just uses a timer every second and updates accordingly, there are other watches involved presumably but the exact code seems difficult to locate.

The suggestion to do this properly is to either wait until there's a fix in the kernel and glib (scheduled some time soon) or to watch for some random dbus traffic that might signify a resume event, or have a 1 second timer that compares the current time with the previously displayed time and triggers an update only if it's changed.

David Barth (dbarth) wrote :

Unless there is a user-option that mandates a frequent update of the display, i'd rather not have the clock wake up the cpu unnecessarily. That would be one less module making a dent in the battery life.

The dbus traffic idea is nice, if you can find a reference signal that either Gnome, or at least Ubuntu, sends on resume. There was the powersave project that defined various signals in that regard, but I'm not sure of the status of it.

Hacks in /etc/acpi or the likes are less desirable, and would require adding a custom dbus api specific to the clock. Whereas the signal could be shared across all system services and indicators that would have a need for it.

Karl Lattimer (karl-qdh) wrote :

I've updated the attached branch to include an implementation of njpatels suggested dbus fix using consolekit signals. The code is loosely based on

http://bazaar.launchpad.net/~netbook-remix-team/netbook-remix-launcher/trunk/view/head:/netbook-launcher/nl-config.c#L502

but modified slightly.

Karl Lattimer (karl-qdh) wrote :

after testing it appears that this method works.

Karl Lattimer (karl-qdh) on 2011-03-31
Changed in indicator-datetime:
status: In Progress → Fix Committed
Changed in unity-foundations:
status: In Progress → Fix Committed
Karl Lattimer (karl-qdh) wrote :

further testing shows it doesn't work, might have resumed a couple of times close to the refresh timer :/

Changed in indicator-datetime:
status: Fix Committed → In Progress
Changed in unity-foundations:
status: Fix Committed → In Progress
Karl Lattimer (karl-qdh) wrote :

Changed to using the SystemIdleHintChanged signal, new branch attached which fixes this bug for certain.

Ted Gould (ted) on 2011-03-31
Changed in indicator-datetime:
status: In Progress → Fix Committed
milestone: none → 0.2.1
Ted Gould (ted) on 2011-03-31
Changed in indicator-datetime:
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-datetime - 0.2.1-0ubuntu1

---------------
indicator-datetime (0.2.1-0ubuntu1) natty; urgency=low

  * New upstream release.
    * indicator-datetime-preferences crashed with SIGSEGV in
      g_utf8_normalize() (LP: #727089)
    * Uninstalling Evolution removes calendar from clock applet (LP: #691953)
    * clock doesn't update on timezone change (LP: #735445)
    * Cannot change main location (LP: #729029)
    * indicator-datetime-preferences crashed with SIGSEGV in
      g_simple_async_result_complete() (LP: #734951)
    * Time zone map looks identical when sensitive vs. insensitive (LP: #740846)
    * "Locations" window behaves like a modal dialog (LP: #740924)
    * Added location for clock menu isn't used or remembered (LP: #740930)
    * Time not displayed for added location in "Locations" window (LP: #740931)
    * "UTC" location can be removed but not re-added (LP: #740938)
    * "Locations" window bottom bar is missing a border (LP: #740941)
    * Add and Remove buttons in "Locations" window have unnecessary tooltips
      (LP: #740944)
    * No separator between "Add Event" and locations (LP: #740971)
    * indicator-datetime-preferences crashed with SIGSEGV in
      g_atomic_int_exchange_and_add() (LP: #740978)
    * inicator-datetime dosen't show corretly the time when changing from 24
      hours format to 12 hours (LP: #743394)
    * Add tooltips on the error icons
    * Fix marking to refresh as the calendar changes
    * Recycle old entries to make the refresh cleaner
    * Use day when timezone is set to 'locale'
    * Reset time when coming back from suspend (LP: #726053)
 -- Ted Gould <email address hidden> Thu, 31 Mar 2011 14:32:40 -0500

Changed in indicator-datetime (Ubuntu):
status: In Progress → Fix Released
David Barth (dbarth) on 2011-04-04
Changed in unity-foundations:
status: In Progress → Fix Released

The problem still occurs here with Ubuntu 11.10 and indicator-datetime 0.3.1-0ubuntu1. Did I miss something?

Jan Rathmann (kaiserclaudius) wrote :

I am experiencing this bug nearly every time my PC wakes up from Suspend-to-RAM, so I wouldn't consider it fixed. I have used Unity from Natty to Precise (my current installation) and the bug was always present during the last 15 months, regardless if I was running Natty, Oneiric or Precise.

Kind regards,
Jan

Roman Yepishev (rye) wrote :

Also experiencing this issue on current Precise.

ConsoleKit does not appear to send SystemIdleHintChanged upon resume, thus indicator-datetime does not know it needs to be updated. I filed a ConsoleKit bug 1028278.

Anca Emanuel (anca-emanuel) wrote :

NOT fixed for any Ubuntu version.
I wake up the laptop and the date is allways yesterday.

Sebastien Bacher (seb128) wrote :

can you open a new bug if you still have an issue?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers