After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657074 - clock: Switch to using g_date_time_create_watch()
clock: Switch to using g_date_time_create_watch()
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 657075 670770 (view as bug list)
Depends on: 657955
Blocks:
 
 
Reported: 2011-08-22 12:56 UTC by Colin Walters
Modified: 2012-06-22 22:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
clock: Switch to using g_date_time_create_watch() (13.18 KB, patch)
2011-08-22 12:56 UTC, Colin Walters
none Details | Review
clock: Switch to using GnomeWallClock, delete clock GSettings controls (6.35 KB, patch)
2011-09-01 17:12 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2011-08-22 12:56:49 UTC
This avoids us having to poll once a second.  Because GSource isn't
introspectable, we need to make a C utility class.

Note that GTimezoneMonitor was never used in gnome-shell; here we also
add an inotify watch on /etc/localtime.

Thus the clock should update more or less instantly after:

1) A minute expires
2) The schema changes
3) The system realtime clock is modified discontiguously
  - Including resume from suspend
4) The system time zone changes
Comment 1 Colin Walters 2011-08-22 12:56:53 UTC
Created attachment 194360 [details] [review]
clock: Switch to using g_date_time_create_watch()
Comment 2 Colin Walters 2011-08-22 13:30:39 UTC
*** Bug 657075 has been marked as a duplicate of this bug. ***
Comment 3 Bastien Nocera 2011-08-26 18:48:29 UTC
For watching the timezone changes, you could watch it through systemd:
http://www.freedesktop.org/wiki/Software/systemd/timedated
Comment 4 Colin Walters 2011-09-01 17:12:02 UTC
Created attachment 195412 [details] [review]
clock: Switch to using GnomeWallClock, delete clock GSettings controls

This avoids us having to poll once a second, among other things.  For
more information, see the linked bug chain.

See https://bugzilla.gnome.org/show_bug.cgi?id=657958 for the new
clock keys.
Comment 5 Owen Taylor 2011-09-01 17:31:40 UTC
It really doesn't make sense to me that every place where we might want to show a clock in GNOME would have the same user preference as to whether we show the date or not.
Comment 6 Colin Walters 2011-09-01 17:39:55 UTC
(In reply to comment #5)
> It really doesn't make sense to me that every place where we might want to show
> a clock in GNOME would have the same user preference as to whether we show the
> date or not.

I see this as unifying the code/configuration for screensaver (should exactly match shell AFAIK), and in the future, fallback (if we don't declare it dead via mesa fixes).

What other clocks are you thinking of?
Comment 7 Bastien Nocera 2011-09-01 18:11:33 UTC
There's another clock in the display panel, where we replicate the top panel look as well.
Comment 8 Colin Walters 2011-09-03 15:34:17 UTC
It'd be nice to land this before string freeze, since these are highly visible strings.
Comment 9 Dan Winship 2011-09-05 15:26:57 UTC
(In reply to comment #8)
> It'd be nice to land this before string freeze, since these are highly visible
> strings.

the new strings are all in gnome-desktop, and that patch already landed.

(not reviewing since it's therefore not urgent, and Owen had commented before so I'll let him follow up.)
Comment 10 Jasper St. Pierre (not reading bugmail) 2012-02-07 20:24:29 UTC
Review of attachment 195412 [details] [review]:

The wall-clock code in gnome-desktop doesn't resume on suspend wakeup. Do we still need to do that?
Comment 11 Colin Walters 2012-02-07 23:43:17 UTC
(In reply to comment #10)
> Review of attachment 195412 [details] [review]:
> 
> The wall-clock code in gnome-desktop doesn't resume on suspend wakeup. Do we
> still need to do that?

That should happen automatically via timerfd; I tested it and it worked.  Now it's certainly possible it regressed...
Comment 12 Owen Taylor 2012-02-27 21:06:10 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > It really doesn't make sense to me that every place where we might want to show
> > a clock in GNOME would have the same user preference as to whether we show the
> > date or not.
> 
> I see this as unifying the code/configuration for screensaver (should exactly
> match shell AFAIK), and in the future, fallback (if we don't declare it dead
> via mesa fixes).
> 
> What other clocks are you thinking of?

It still makes little sense to me to combine:

 "How do you create a clock that behaves right with respect to wakeups, etc"

With:

 "What is the users setting (or designers choice) for how the clock appears on the top panel, and clones of the top panel, like the screen saver and the display panel"

But whatever, GnomeDesktop is an internal implementation detail of the desktop, its apis don't have to make a lot of sense :-)
Comment 13 Colin Walters 2012-02-28 09:38:25 UTC
*** Bug 670770 has been marked as a duplicate of this bug. ***
Comment 14 Colin Walters 2012-02-28 09:39:05 UTC
Comment on attachment 195412 [details] [review]
clock: Switch to using GnomeWallClock, delete clock GSettings controls

See https://bugzilla.gnome.org/show_bug.cgi?id=670770 for a newer patch
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-05-30 00:01:25 UTC
So do we want to land anything in here?
Comment 16 Colin Walters 2012-06-05 20:56:53 UTC
Comment on attachment 195412 [details] [review]
clock: Switch to using GnomeWallClock, delete clock GSettings controls

I don't think this is actually obsolete; we can still remove duplicate configuration between shell/screensaver, and this also causes us to instantly update for timezone changes.
Comment 17 Jasper St. Pierre (not reading bugmail) 2012-06-05 21:10:52 UTC
Review of attachment 195412 [details] [review]:

The code seems fine to me.
Comment 18 Colin Walters 2012-06-22 22:15:31 UTC
Attachment 195412 [details] pushed as ef0aa65 - clock: Switch to using GnomeWallClock, delete clock GSettings controls