GNOME Bugzilla – Bug 657074
clock: Switch to using g_date_time_create_watch()
Last modified: 2012-06-22 22:15:34 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
Created attachment 194360 [details] [review] clock: Switch to using g_date_time_create_watch()
*** Bug 657075 has been marked as a duplicate of this bug. ***
For watching the timezone changes, you could watch it through systemd: http://www.freedesktop.org/wiki/Software/systemd/timedated
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.
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.
(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?
There's another clock in the display panel, where we replicate the top panel look as well.
It'd be nice to land this before string freeze, since these are highly visible strings.
(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.)
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?
(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...
(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 :-)
*** Bug 670770 has been marked as a duplicate of this bug. ***
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
So do we want to land anything in here?
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.
Review of attachment 195412 [details] [review]: The code seems fine to me.
Attachment 195412 [details] pushed as ef0aa65 - clock: Switch to using GnomeWallClock, delete clock GSettings controls