diff options
Diffstat (limited to 'xorg-server/dix/getevents.c')
-rw-r--r-- | xorg-server/dix/getevents.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index d5d6a78b1..3dceeb7ae 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -65,6 +65,21 @@ #include "extnsionst.h"
#include "listdev.h" /* for sizing up DeviceClassesChangedEvent */
+#ifdef _MSC_VER
+#include <math.h>
+
+float roundf(float f)
+{
+ return ((f<0.0f) ? ceil(f-.5) : floor (f+.5));
+}
+double roundd(double f)
+{
+ return ((f<0.0) ? ceil(f-.5) : floor (f+.5));
+}
+#define lroundf(val) ((int)roundf(val))
+#define lround(val) ((int)roundd(val))
+#endif
+
/* Number of motion history events to store. */
#define MOTION_HISTORY_SIZE 256
@@ -943,7 +958,7 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, ValuatorMask mask;
/* refuse events from disabled devices */
- if (!pDev->enabled)
+ if (!pDev || !pDev->enabled)
return 0;
if (!events ||!pDev->key || !pDev->focus || !pDev->kbdfeed ||
@@ -1139,7 +1154,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, }
if (valuator_mask_isset(&mask, 1))
{
- scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 0),
+ scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 1),
0.0, &y_frac, NULL,
pDev->valuator->axes + 1,
scr->height);
|