summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-01-24 13:54:09 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-01-24 13:54:09 +0000
commit2e356f5b191cf1835a8f82a7646467948edbcc5c (patch)
treef637d0cf90734904d1f7e6c02cc0d4a2ed75f093
parent4f0bd75052bc04b11d7b3f7469aacdb49395eb99 (diff)
downloaddrakx-2e356f5b191cf1835a8f82a7646467948edbcc5c.tar
drakx-2e356f5b191cf1835a8f82a7646467948edbcc5c.tar.gz
drakx-2e356f5b191cf1835a8f82a7646467948edbcc5c.tar.bz2
drakx-2e356f5b191cf1835a8f82a7646467948edbcc5c.tar.xz
drakx-2e356f5b191cf1835a8f82a7646467948edbcc5c.zip
remove blinks in mouse test
-rw-r--r--perl-install/mouse.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm
index c650d4d23..0be74b451 100644
--- a/perl-install/mouse.pm
+++ b/perl-install/mouse.pm
@@ -467,7 +467,8 @@ sub test_mouse {
};
my $drawarea;
$drawarea = sub {
- $draw_pixbuf->($image, 0, 0, 210, 350);
+ my ($height) = @_;
+ $draw_pixbuf->($image, 0, 0, 210, $height || 200);
if ($::isInstall) {
$draw_text->(N("Please test the mouse"), $height - 120);
if ($x_protocol_changed && $mouse->{nbuttons} > 3 && member($mouse->{XMOUSETYPE}, 'IMPS/2', 'ExplorerPS/2')) {
@@ -477,10 +478,11 @@ sub test_mouse {
}
};
+ my $timeout;
my $paintButton = sub {
my ($nb) = @_;
my $x = 60 + $nb*33;
- $drawarea->();
+ $timeout or $drawarea->();
if ($nb == 0) {
$draw_pixbuf->($xpms{left}, 31, 52, 59, 91);
} elsif ($nb == 2) {
@@ -500,14 +502,15 @@ sub test_mouse {
$draw_pixbuf->($xpms{ad}, 102, 131, 6, 8);
}
$draw_pixbuf->($xpms{middle}, 98, 67, 13, 62);
- Gtk2->timeout_add(200, sub { $drawarea->(); 0 });
+ $timeout and Gtk2->timeout_remove($timeout);
+ $timeout = Gtk2->timeout_add(100, sub { $drawarea->(); $timeout = 0; 0 });
}
};
$darea->signal_connect(button_press_event => sub { $paintButton->($_[1]->button - 1) });
$darea->signal_connect(scroll_event => sub { $paintButton->($_[1]->direction eq 'up' ? 3 : 4) });
$darea->signal_connect(button_release_event => sub { $drawarea->() });
- $darea->signal_connect(expose_event => sub { $drawarea->() });
+ $darea->signal_connect(expose_event => sub { $drawarea->(350) });
$darea->set_size_request($width, $height);
}