Updating branch refs/heads/master
         to d19e600937b0704ca5ae927d24a0b4db93e5e371 (commit)
       from d475996395d66d138359dfb45a51126448244c34 (commit)

commit d19e600937b0704ca5ae927d24a0b4db93e5e371
Author: Nick Schermer <n...@xfce.org>
Date:   Tue Oct 6 11:17:13 2009 +0200

    Better check for the lcd resize  when the number of hour digits changes 
(bug #5218).

 plugins/clock/clock-lcd.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/plugins/clock/clock-lcd.c b/plugins/clock/clock-lcd.c
index c576411..4746b89 100644
--- a/plugins/clock/clock-lcd.c
+++ b/plugins/clock/clock-lcd.c
@@ -327,8 +327,12 @@ xfce_clock_lcd_expose_event (GtkWidget      *widget,
         if (!lcd->show_military && ticks > 12)
             ticks -= 12;
 
-        /* queue a resize when the number of hour digits changed */
-        if (G_UNLIKELY ((ticks == 10 || ticks == 0) && tm.tm_min == 0 && 
tm.tm_sec == 0))
+        /* queue a resize when the number of hour digits changed,
+         * because we might miss the exact second (due to slightly delayed
+         * timeout) we queue a resize the first 3 seconds or anything in
+         * the first minute when seconds are disabled */
+        if ((ticks == 10 || ticks == 0) && tm.tm_min == 0
+            && (!lcd->show_seconds || tm.tm_sec < 3))
           gtk_widget_queue_resize (widget);
 
         if (ticks >= 10)
@@ -500,7 +504,7 @@ xfce_clock_lcd_draw_digit (cairo_t *cr,
                              { 3, 2, 1, 0, 5, 6, -1 },
                              { 4, 5, 0, 1, 2, 6, -1 },
                              { 4, 5, 0, 1, 6, -1 } };
-                             
+
     g_return_val_if_fail ((gint) number >= 0 || number <= 11, offset_x);
 
     for (i = 0; i < 9; i++)
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to