summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/drakclock8
1 files changed, 5 insertions, 3 deletions
diff --git a/perl-install/standalone/drakclock b/perl-install/standalone/drakclock
index c9fcf0c46..deb192bd5 100755
--- a/perl-install/standalone/drakclock
+++ b/perl-install/standalone/drakclock
@@ -319,7 +319,7 @@ sub determine_radian {
sub draw {
my ($widget, $event) = @_;
$cairo = $event;
- Repaint();
+ Repaint(undef, 1);
0;
}
@@ -340,7 +340,7 @@ sub time_to_rad {
}
sub Repaint {
- my ($o_update_time) = @_;
+ my ($o_update_time, $skip_redraw) = @_;
my ($sec, $min, $hour) = localtime(time());
time_to_rad($sec, $min, $hour) if $o_update_time;
($midx, $midy) = ($drawing_area->get_allocated_width/2, $drawing_area->get_allocated_height/2);
@@ -353,7 +353,9 @@ sub Repaint {
DrawHour();
DrawMin();
DrawSec();
- $drawing_area->queue_draw;
+ # Only redraw the clock if there are changes.
+ # This highly decreases the CPU usage.
+ $drawing_area->queue_draw unless $skip_redraw;
1;
}