diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-01-24 13:36:00 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-01-24 13:36:00 +0000 |
commit | 4f0bd75052bc04b11d7b3f7469aacdb49395eb99 (patch) | |
tree | bd6597ec62137834130762d8039705a45e2e7c8e /perl-install/install_steps_gtk.pm | |
parent | cdb055ea5be12bbef6a836db2cdc69ae78af817b (diff) | |
download | drakx-4f0bd75052bc04b11d7b3f7469aacdb49395eb99.tar drakx-4f0bd75052bc04b11d7b3f7469aacdb49395eb99.tar.gz drakx-4f0bd75052bc04b11d7b3f7469aacdb49395eb99.tar.bz2 drakx-4f0bd75052bc04b11d7b3f7469aacdb49395eb99.tar.xz drakx-4f0bd75052bc04b11d7b3f7469aacdb49395eb99.zip |
- don't setMouseLive when the protocol hasn't changed
- don't say "MOVE YOUR WHEEL" when there is no wheel and the protocol hasn't changed
(nb: no wheel + IMPS/2 can now happen for usb mice)
Diffstat (limited to 'perl-install/install_steps_gtk.pm')
-rw-r--r-- | perl-install/install_steps_gtk.pm | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 583fb8a47..ebb849d39 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -163,15 +163,21 @@ sub selectMouse { local $ugtk2::grab = 1; #- unsure a crazy mouse don't go wild clicking everywhere while (1) { - log::l("telling X server to use another mouse"); - eval { modules::load('serial') } if $mouse->{device} =~ /ttyS/; - - if (!$::testing) { - devices::make($mouse->{device}); - symlinkf($mouse->{device}, "/dev/mouse"); - c::setMouseLive($ENV{DISPLAY}, mouse::xmouse2xId($mouse->{XMOUSETYPE}), $mouse->{nbuttons} < 3); + my $xId = mouse::xmouse2xId($mouse->{XMOUSETYPE}); + my $x_protocol_changed = $old{device} ne $mouse->{device} || $xId != mouse::xmouse2xId($old{XMOUSETYPE}); + if ($x_protocol_changed) { + log::l("telling X server to use another mouse"); + eval { modules::load('serial') } if $mouse->{device} =~ /ttyS/; + + if (!$::testing) { + devices::make($mouse->{device}); + symlinkf($mouse->{device}, "/dev/mouse"); + c::setMouseLive($ENV{DISPLAY}, $xId, $mouse->{nbuttons} < 3); + } } - mouse::test_mouse_install($mouse) and return; + mouse::test_mouse_install($mouse, $x_protocol_changed) and return; + + %old = %$mouse; $o->SUPER::selectMouse(1); $mouse = $o->{mouse}; } |