diff options
Diffstat (limited to 'gnome-base/gnome-panel/files/gnome-panel-2.16.1-no-seconds.patch')
-rw-r--r-- | gnome-base/gnome-panel/files/gnome-panel-2.16.1-no-seconds.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/gnome-base/gnome-panel/files/gnome-panel-2.16.1-no-seconds.patch b/gnome-base/gnome-panel/files/gnome-panel-2.16.1-no-seconds.patch new file mode 100644 index 0000000..d76907d --- /dev/null +++ b/gnome-base/gnome-panel/files/gnome-panel-2.16.1-no-seconds.patch @@ -0,0 +1,65 @@ +From Fedora Core 6: + +https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=204862 +http://cvs.fedora.redhat.com/viewcvs/*checkout*/rpms/gnome-panel/devel/gnome-panel-2.15.92-no-seconds.patch?rev=1.1 +http://bugzilla.gnome.org/attachment.cgi?id=72039&action=view + +Alternative approach discussion on upstream bug, with possibly better timezone change notification done in the future: +http://bugzilla.gnome.org/show_bug.cgi?id=348749 + +--- gnome-panel-2.15.92/applets/clock/clock.c.no-seconds 2006-09-01 13:52:10.000000000 -0400 ++++ gnome-panel-2.15.92/applets/clock/clock.c 2006-09-01 13:56:36.000000000 -0400 +@@ -48,6 +48,7 @@ + #include <string.h> + #include <time.h> + #include <langinfo.h> ++#include <sys/time.h> + + #include <panel-applet.h> + #include <panel-applet-gconf.h> +@@ -243,6 +244,7 @@ + { + ClockData *cd = data; + time_t new_time; ++ int timeouttime; + + time (&new_time); + +@@ -262,7 +264,20 @@ + update_clock (cd); + } + +- return TRUE; ++ if (cd->format == CLOCK_FORMAT_INTERNET) ++ timeouttime = INTERNETSECOND; ++ else { ++ struct timeval tv; ++ gettimeofday(&tv, NULL); ++ timeouttime = (1000000 - tv.tv_usec)/1000+1; ++ if (!cd->showseconds) ++ timeouttime += 1000 * (59 - cd->current_time % 60); ++ } ++ cd->timeout = g_timeout_add (timeouttime, ++ clock_timeout_callback, ++ cd); ++ ++ return FALSE; + } + + static float +@@ -489,8 +504,13 @@ + + if (cd->format == CLOCK_FORMAT_INTERNET) + timeouttime = INTERNETSECOND; +- else +- timeouttime = 1000; ++ else { ++ struct timeval tv; ++ gettimeofday(&tv, NULL); ++ timeouttime = (1000000 - tv.tv_usec)/1000+1; ++ if (!cd->showseconds) ++ timeouttime += 1000 * (59 - cd->current_time % 60); ++ } + + cd->timeout = g_timeout_add (timeouttime, + clock_timeout_callback, |