diff options
author | marha <marha@users.sourceforge.net> | 2012-02-29 13:47:34 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-02-29 13:47:34 +0100 |
commit | c14f2432d6bfb3de6c6289efd0471f038a289327 (patch) | |
tree | 8864ad1e5d0ae65dd665aa45245f2dab86c3f178 /xorg-server | |
parent | 8475e285d0146b123f0ac1a87294c42088af12b0 (diff) | |
parent | 15a500d3edb03668b43cc6898fafcda024d0f006 (diff) | |
download | vcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.tar.gz vcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.tar.bz2 vcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'xorg-server')
-rw-r--r-- | xorg-server/dix/getevents.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index 8091c5782..ed529722c 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -855,10 +855,15 @@ scale_to_desktop(DeviceIntPtr dev, ValuatorMask *mask, ScreenPtr scr = miPointerGetScreen(dev); double x, y; - BUG_WARN(!dev->valuator); - BUG_WARN(dev->valuator->numAxes < 2); + BUG_WARN(!dev->valuator || dev->valuator->numAxes < 2); if (!dev->valuator || dev->valuator->numAxes < 2) + { + /* if we have no axes, last.valuators must be in screen coords + * anyway */ + *devx = *screenx = dev->last.valuators[0]; + *devy = *screeny = dev->last.valuators[1]; return scr; + } if (valuator_mask_isset(mask, 0)) x = valuator_mask_get_double(mask, 0); @@ -1514,8 +1519,6 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, { CARD32 ms = GetTimeInMillis(); int num_events = 0, nev_tmp; - int h_scroll_axis = pDev->valuator->h_scroll_axis; - int v_scroll_axis = pDev->valuator->v_scroll_axis; ValuatorMask mask; ValuatorMask scroll; int i; @@ -1540,6 +1543,14 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, { double val, adj; int axis; + int h_scroll_axis = -1; + int v_scroll_axis = -1; + + if (pDev->valuator) + { + h_scroll_axis = pDev->valuator->h_scroll_axis; + v_scroll_axis = pDev->valuator->v_scroll_axis; + } /* Up is negative on valuators, down positive */ switch (buttons) { |