[Xfce4-commits] <xfce4-time-out-plugin:master> Only call gtk_progress_set_percentage() with valid value (bug #7660)
Landry Breuil
noreply at xfce.org
Sun Apr 15 23:52:01 CEST 2012
Updating branch refs/heads/master
to 834bf11d380b77276b00af0caed5cea27ccb275d (commit)
from 2cd8fe785307e2d96de225abbab86b212137d351 (commit)
commit 834bf11d380b77276b00af0caed5cea27ccb275d
Author: Landry Breuil <landry at xfce.org>
Date: Sun Apr 15 23:47:09 2012 +0200
Only call gtk_progress_set_percentage() with valid value (bug #7660)
Fix taken from the bug report, but the logic is wrong somewhere.
lock_countdown shouldnt call time_out_lock_screen_set_remaining()
every second, and shouldnt even be running when break_countdown
is running too.
Fixes gtk warnings spamming session logs:
Gtk-CRITICAL **: IA__gtk_progress_set_percentage: assertion `percentage >= 0 && percentage <= 1.0' failed
panel-plugin/time-out-lock-screen.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/panel-plugin/time-out-lock-screen.c b/panel-plugin/time-out-lock-screen.c
index f36f318..6b3e111 100644
--- a/panel-plugin/time-out-lock-screen.c
+++ b/panel-plugin/time-out-lock-screen.c
@@ -323,9 +323,11 @@ time_out_lock_screen_set_remaining (TimeOutLockScreen *lock_screen,
/* Update widgets */
gtk_label_set_markup (GTK_LABEL (lock_screen->time_label), time_string->str);
- gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (lock_screen->progress),
+ if ((0 < lock_screen->max_seconds) && (0 <= seconds) && (seconds <= lock_screen->max_seconds))
+ {
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (lock_screen->progress),
((gdouble)seconds) / ((gdouble)lock_screen->max_seconds));
-
+ }
/* Free time string */
g_string_free (time_string, TRUE);
}
More information about the Xfce4-commits
mailing list