diff options
-rw-r--r-- | perl-install/install_gtk.pm | 4 | ||||
-rw-r--r-- | perl-install/install_steps_gtk.pm | 20 | ||||
-rw-r--r-- | perl-install/my_gtk.pm | 6 |
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; |