summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-09-13 00:06:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-09-13 00:06:38 +0000
commit3c3f7b7a5ef5feef684d6ce66b060aa88df6cddf (patch)
treefe557abb183bfb67669efa97e07d6c5073ee31fd /perl-install
parent24985f95a0e1eb72143d31b19d0c24f74d284982 (diff)
downloaddrakx-3c3f7b7a5ef5feef684d6ce66b060aa88df6cddf.tar
drakx-3c3f7b7a5ef5feef684d6ce66b060aa88df6cddf.tar.gz
drakx-3c3f7b7a5ef5feef684d6ce66b060aa88df6cddf.tar.bz2
drakx-3c3f7b7a5ef5feef684d6ce66b060aa88df6cddf.tar.xz
drakx-3c3f7b7a5ef5feef684d6ce66b060aa88df6cddf.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_gtk.pm4
-rw-r--r--perl-install/install_steps_gtk.pm20
-rw-r--r--perl-install/my_gtk.pm6
3 files changed, 17 insertions, 13 deletions
diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm
index 40daf8447..e8a2b9716 100644
--- a/perl-install/install_gtk.pm
+++ b/perl-install/install_gtk.pm
@@ -431,8 +431,8 @@ sub test_mouse {
$draw_text->(_("Move your wheel!"), 2 * $bh + 10) if $mouse->{XMOUSETYPE} eq 'IMPS/2';
$paintButton->($_, 0) foreach 0..2;
$w->{cancel}->grab_focus;
- my $timeout = Gtk->timeout_add(1000, sub { if ($time-- == 0) { undef $w->{retval}; Gtk->main_quit } 1 });
- my $b = before_leaving { Gtk->timeout_remove($timeout) };
+# my $timeout = Gtk->timeout_add(1000, sub { if ($time-- == 0) { log::l("timeout test_mouse"); undef $w->{retval}; Gtk->main_quit } 1 });
+# my $b = before_leaving { log::l("removing timeout"); Gtk->timeout_remove($timeout) };
$w->main;
}
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 5254cffa6..fb9bc4504 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -178,8 +178,6 @@ sub selectInstallClass1 {
#------------------------------------------------------------------------------
sub selectMouse {
my ($o, $force) = @_;
- my %old = %{$o->{mouse}};
- $o->SUPER::selectMouse($force);
my $set = sub {
my ($mouse) = @_;
@@ -187,15 +185,21 @@ sub selectMouse {
c::setMouseLive($ENV{DISPLAY}, mouse::xmouse2xId($mouse->{XMOUSETYPE}));
};
- if ($old{XMOUSETYPE} ne $o->{mouse}{XMOUSETYPE}) {
+ my %old = %{$o->{mouse}};
+ $o->SUPER::selectMouse($force);
+ $old{FULLNAME} eq $o->{mouse}{FULLNAME} && !$force and return;
+
+ while (1) {
log::l("telling X server to use another mouse");
eval { commands::modprobe("serial") } if $o->{mouse}{device} =~ /ttyS/;
- $set->($o->{mouse}) unless $::testing;
- }
- if ($old{FULLNAME} ne $o->{mouse}{FULLNAME}) {
- install_gtk::test_mouse($o->{mouse}) or goto &selectMouse;
- }
+ if (!$::testing) {
+ symlinkf($o->{mouse}{device}, "/dev/mouse");
+ c::setMouseLive($ENV{DISPLAY}, mouse::xmouse2xId($o->{mouse}{XMOUSETYPE}));
+ }
+ install_gtk::test_mouse($o->{mouse}) and return;
+ $o->SUPER::selectMouse(1);
+ }
}
#------------------------------------------------------------------------------
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index e59a1404c..55ebdc986 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -45,7 +45,7 @@ sub new {
sub main($;$) {
my ($o, $f) = @_;
gtkset_mousecursor_normal();
- my $timeout = Gtk->timeout_add(1000, sub { log::l("gtkset_mousecursor_normal"); gtkset_mousecursor_normal(); 1 });
+ my $timeout = Gtk->timeout_add(1000, sub { gtkset_mousecursor_normal(); 1 });
my $b = before_leaving { Gtk->timeout_remove($timeout) };
$o->show;
@@ -240,8 +240,8 @@ sub create_okcancel {
$spread ||= $::isWizard ? "edge" : "spread";
$ok ||= $::isWizard ? _("Next ->") : _("Ok");
- my $b1 = gtksignal_connect($w->{ok} = new Gtk::Button($ok), "clicked" => $w->{ok_clicked} || sub { $w->{retval} = 1; Gtk->main_quit });
- my $b2 = !$one && gtksignal_connect($w->{cancel} = new Gtk::Button($cancel || _("Cancel")), "clicked" => $w->{cancel_clicked} || sub { undef $w->{retval}; Gtk->main_quit });
+ my $b1 = gtksignal_connect($w->{ok} = new Gtk::Button($ok), clicked => $w->{ok_clicked} || sub { $w->{retval} = 1; Gtk->main_quit });
+ my $b2 = !$one && gtksignal_connect($w->{cancel} = new Gtk::Button($cancel || _("Cancel")), clicked => $w->{cancel_clicked} || sub { log::l("default cancel_clicked"); undef $w->{retval}; Gtk->main_quit });
my @l = grep { $_ } $::isStandalone ? ($b2, $b1) : ($b1, $b2);
$_->can_default($::isStandalone) foreach @l;