diff options
Diffstat (limited to 'xorg-server/hw/xwin/winmouse.c')
-rw-r--r-- | xorg-server/hw/xwin/winmouse.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/xorg-server/hw/xwin/winmouse.c b/xorg-server/hw/xwin/winmouse.c index 752334a31..75e51c2f9 100644 --- a/xorg-server/hw/xwin/winmouse.c +++ b/xorg-server/hw/xwin/winmouse.c @@ -36,6 +36,13 @@ #endif #include "win.h" +#ifdef XKB +#ifndef XKB_IN_SERVER +#define XKB_IN_SERVER +#endif +#include <xkbsrv.h> +#endif + #include "inputstr.h" #include "exevents.h" /* for button/axes labels */ #include "xserver-properties.h" @@ -44,21 +51,6 @@ /* Peek the internal button mapping */ static CARD8 const *g_winMouseButtonMap = NULL; - -/* - * Local prototypes - */ - -static void -winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl); - - -static void -winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl) -{ -} - - /* * See Porting Layer Definition - p. 18 * This is known as a DeviceProc @@ -68,7 +60,7 @@ int winMouseProc (DeviceIntPtr pDeviceInt, int iState) { int lngMouseButtons, i; - int lngWheelEvents = 2; + int lngWheelEvents = 4; CARD8 *map; DevicePtr pDevice = (DevicePtr) pDeviceInt; Atom *btn_labels; @@ -89,7 +81,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) */ if (lngMouseButtons < 3) lngMouseButtons = 3; - winMsg(X_PROBED, "%d mouse buttons found\n", lngMouseButtons); + winDebug("%d mouse buttons found\n", lngMouseButtons); /* allocate memory: * number of buttons + 2x mouse wheel event + 1 extra (offset for map) @@ -107,6 +99,8 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); + btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); + btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); @@ -115,7 +109,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) map, lngMouseButtons + lngWheelEvents, btn_labels, - winMouseCtrl, + (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2, axes_labels); @@ -243,10 +237,8 @@ winMouseButtonsSendEvent (int iEventType, int iButton) QueuePointerEvents(g_pwinPointer, iEventType, iButton, POINTER_RELATIVE, &mask); -#if CYGDEBUG - ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d\n", + winDebug("winMouseButtonsSendEvent: iEventType: %d, iButton: %d\n", iEventType, iButton); -#endif } @@ -363,8 +355,10 @@ void winEnqueueMotion(int x, int y) { int valuators[2]; ValuatorMask mask; + double dbl_x=(double)x; + double dbl_y=(double)y; - miPointerSetPosition(g_pwinPointer, POINTER_RELATIVE, &x, &y); + miPointerSetPosition(g_pwinPointer, Absolute, &dbl_x, &dbl_y); valuators[0] = x; valuators[1] = y; |