diff --git a/kcms/input/mouse.cpp b/kcms/input/mouse.cpp --- a/kcms/input/mouse.cpp +++ b/kcms/input/mouse.cpp @@ -147,7 +147,7 @@ // Only allow setting reversing scroll polarity if we have scroll buttons unsigned char map[20]; - if ( XGetPointerMapping(QX11Info::display(), map, 20) >= 5 ) + if (QX11Info::isPlatformX11() && XGetPointerMapping(QX11Info::display(), map, 20) >= 5 ) { generalTab->cbScrollPolarity->setEnabled( true ); generalTab->cbScrollPolarity->show(); @@ -504,49 +504,56 @@ void MouseSettings::load(KConfig *config, Display *dpy) { - int accel_num, accel_den, threshold; - double accel; - - XGetPointerControl( dpy, - &accel_num, &accel_den, &threshold ); - accel = float(accel_num) / float(accel_den); - - // get settings from X server - int h = RIGHT_HANDED; - unsigned char map[20]; - num_buttons = XGetPointerMapping(dpy, map, 20); - - handedEnabled = true; - - // ## keep this in sync with KGlobalSettings::mouseSettings - if( num_buttons == 1 ) - { - /* disable button remapping */ - handedEnabled = false; - } - else if( num_buttons == 2 ) - { - if ( (int)map[0] == 1 && (int)map[1] == 2 ) - h = RIGHT_HANDED; - else if ( (int)map[0] == 2 && (int)map[1] == 1 ) - h = LEFT_HANDED; - else - /* custom button setup: disable button remapping */ - handedEnabled = false; - } - else - { - middle_button = (int)map[1]; - if ( (int)map[0] == 1 && (int)map[2] == 3 ) - h = RIGHT_HANDED; - else if ( (int)map[0] == 3 && (int)map[2] == 1 ) - h = LEFT_HANDED; - else - { - /* custom button setup: disable button remapping */ - handedEnabled = false; + // TODO: what's a good threshold default value + int threshold = 0; + int h = RIGHT_HANDED; + double accel = 1.0; + if (QX11Info::isPlatformX11()) { + int accel_num, accel_den; + + XGetPointerControl( dpy, + &accel_num, &accel_den, &threshold ); + accel = float(accel_num) / float(accel_den); + + // get settings from X server + unsigned char map[20]; + num_buttons = XGetPointerMapping(dpy, map, 20); + + handedEnabled = true; + + // ## keep this in sync with KGlobalSettings::mouseSettings + if( num_buttons == 1 ) + { + /* disable button remapping */ + handedEnabled = false; + } + else if( num_buttons == 2 ) + { + if ( (int)map[0] == 1 && (int)map[1] == 2 ) + h = RIGHT_HANDED; + else if ( (int)map[0] == 2 && (int)map[1] == 1 ) + h = LEFT_HANDED; + else + /* custom button setup: disable button remapping */ + handedEnabled = false; + } + else + { + middle_button = (int)map[1]; + if ( (int)map[0] == 1 && (int)map[2] == 3 ) + h = RIGHT_HANDED; + else if ( (int)map[0] == 3 && (int)map[2] == 1 ) + h = LEFT_HANDED; + else + { + /* custom button setup: disable button remapping */ + handedEnabled = false; + } + } + } else { + // other platforms + handedEnabled = true; } - } KConfigGroup group = config->group("Mouse"); double a = group.readEntry("Acceleration",-1.0); diff --git a/kcms/input/mouse.desktop b/kcms/input/mouse.desktop --- a/kcms/input/mouse.desktop +++ b/kcms/input/mouse.desktop @@ -8,7 +8,6 @@ X-KDE-Library=kcm_input X-KDE-Init-Symbol=mouse X-KDE-ParentApp=kcontrol -X-KDE-OnlyShowOnQtPlatforms=xcb; X-KDE-Init-Phase=0 X-KDE-System-Settings-Parent-Category=input-devices