Description of problem: the clock applet updates itself every second, even when the clock isn't configured to show seconds. This of course eats power when (tickless) idle. Solution is simple, update less frequent when not showing seconds.. see attached patch
Created attachment 135345 [details] patch to poll less frequent when not showing seconds
ok that patch was a fugly hack; this one is nicer: Instead of doing a repeating constant timer, calculate the time to the next redraw event and just make the timer not rearm. This has 2 advantages 1) it is more accurate; the old clock was only second accurate, the new clock is much more accurate 2) there are no spurious timer wake events at all, the only wake events that happen have real work to do strace of the new clock to show how nice it works: 9:26:23.634270 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14, events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 36366) = 0 09:27:00.000822 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074, ...}) = 0 09:27:00.001303 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074, ...}) = 0 09:27:00.001485 ioctl(3, FIONREAD, [0]) = 0 09:27:00.001581 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14, events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 0) = 0 09:27:00.001998 write(3, "5\20\4\0@\0\200\1!\0\200\1=\0\30\0\231\4\5\0A\0\200\1@"..., 652) = 652 09:27:00.002103 ioctl(3, FIONREAD, [0]) = 0 09:27:00.002170 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14, events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 59999) = 0 09:28:00.001798 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074, ...}) = 0 09:28:00.002202 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074, ...}) = 0 notice how all the procesing happens exactly in the first few microseconds of the new minute
Created attachment 135362 [details] patch to make the clock applet wakeup event be at exactly the right time for redrawing rather than polling for it
Compare http://bugzilla.gnome.org/show_bug.cgi?id=348749
Fixed in 2.15.92-6.fc6