Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > a6bc312ce50b5c8d0c51736e58ac32bc > files > 202

kdebase-3.4.2-55mdk.src.rpm

--- kdebase-3.2/kcontrol/input/mouse.cpp.fix_kcontrol_mouse	2004-02-26 13:11:48.000000000 +0100
+++ kdebase-3.2/kcontrol/input/mouse.cpp	2004-03-05 12:00:30.000000000 +0100
@@ -144,8 +144,8 @@ MouseConfig::MouseConfig (QWidget * pare
     connect( tab1->cbAutoSelect, SIGNAL( clicked() ), this, SLOT( slotClick() ) );
 
     // Only allow setting reversing scroll polarity if we have scroll buttons
-    unsigned char map[5];
-    if ( XGetPointerMapping(kapp->getDisplay(), map, 5) == 5 )
+    unsigned char map[7];
+    if ( (XGetPointerMapping(kapp->getDisplay(), map, 7) == 5) || (XGetPointerMapping(kapp->getDisplay(), map, 7) == 7) )
     {
       tab1->cbScrollPolarity->setEnabled( true );
       tab1->cbScrollPolarity->show();
@@ -565,8 +565,8 @@ void MouseSettings::load(KConfig *config
   // get settings from X server
   int h = RIGHT_HANDED;
   bool revScroll = false;
-  unsigned char map[5];
-  num_buttons = XGetPointerMapping(kapp->getDisplay(), map, 5);
+  unsigned char map[7];
+  num_buttons = XGetPointerMapping(kapp->getDisplay(), map, 7);
 
   handedEnabled = true;
 
@@ -588,6 +588,7 @@ void MouseSettings::load(KConfig *config
       break;
     case 3:
     case 5:
+	case 7:
       middle_button = (int)map[1];
       if ( (int)map[0] == 1 && (int)map[2] == 3 )
     h = RIGHT_HANDED;
@@ -604,7 +605,7 @@ void MouseSettings::load(KConfig *config
       handedEnabled = false;
       break;
     }
-  if ( handedEnabled && num_buttons == 5 && ( int )map[3] == 5 && ( int )map[4] == 4 )
+  if ( handedEnabled && (num_buttons == 5 || num_buttons == 7)&& ( int )map[3] == 5 && ( int )map[4] == 4 )
     revScroll = true;
 
 
@@ -649,7 +650,7 @@ void MouseSettings::apply()
   XChangePointerControl( kapp->getDisplay(),
                          true, true, int(qRound(accelRate*10)), 10, thresholdMove);
 
-  unsigned char map[5];
+  unsigned char map[7];
   int remap=1;
   if (handedEnabled && m_handedNeedsApply) {
       switch (num_buttons) {
@@ -679,6 +680,7 @@ void MouseSettings::apply()
           }
           break;
       case 5:
+	  case 7:
           // Intellimouse case, where buttons 1-3 are left, middle, and
           // right, and 4-5 are up/down depending on scroll polarity
           if (handed == RIGHT_HANDED) {