[Xfce4-commits] <xfce4-panel:xfce-4.6> Better check for the lcd resize when the number of hour digits changes (bug #5218).
Nick Schermer
noreply at xfce.org
Fri Oct 16 14:30:07 CEST 2009
Updating branch refs/heads/xfce-4.6
to 3d7e2eabc7009a6252c9ce6b17fb5971e2454744 (commit)
from f95283cb37df8ab067a7c1a8ba26a4064e639605 (commit)
commit 3d7e2eabc7009a6252c9ce6b17fb5971e2454744
Author: Nick Schermer <nick at 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++)
More information about the Xfce4-commits
mailing list