diff options
author | marha <marha@users.sourceforge.net> | 2011-12-16 20:49:54 +0100 |
---|---|---|
committer | Marc Haesen <marc@hc-consult.be> | 2011-12-16 20:46:08 +0100 |
commit | 1ae4005bfe3690b34ec40e33918b3e24468d47e1 (patch) | |
tree | 451bee4796d3058f90af4e66f2cfbdfbe6c77bfe /xorg-server/dix/getevents.c | |
parent | 64718ba8bdcecd8d736a48239847b1f9aadd40ea (diff) | |
parent | 47913e82955ec8e2b1ba4d4b145497dede9163b5 (diff) | |
download | vcxsrv-1ae4005bfe3690b34ec40e33918b3e24468d47e1.tar.gz vcxsrv-1ae4005bfe3690b34ec40e33918b3e24468d47e1.tar.bz2 vcxsrv-1ae4005bfe3690b34ec40e33918b3e24468d47e1.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/dix/dispatch.c
xorg-server/dix/registry.c
xorg-server/include/resource.h
xorg-server/os/access.c
xorg-server/os/auth.c
Diffstat (limited to 'xorg-server/dix/getevents.c')
-rw-r--r-- | xorg-server/dix/getevents.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index 983bbc0e2..c843568b3 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -1115,6 +1115,30 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) valuator_mask_set_double(mask, 1, y); } +static void +storeLastValuators(DeviceIntPtr dev, ValuatorMask *mask, + int xaxis, int yaxis, + double devx, double devy) +{ + int i; + + /* store desktop-wide in last.valuators */ + if (valuator_mask_isset(mask, xaxis)) + dev->last.valuators[0] = devx; + if (valuator_mask_isset(mask, yaxis)) + dev->last.valuators[1] = devy; + + for (i = 0; i < valuator_mask_size(mask); i++) + { + if (i == xaxis || i == yaxis) + continue; + + if (valuator_mask_isset(mask, i)) + dev->last.valuators[i] = valuator_mask_get_double(mask, i); + } + +} + /** * Generate internal events representing this pointer event and enqueue them * on the event queue. @@ -1183,7 +1207,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons, CARD32 ms, int flags, const ValuatorMask *mask_in) { - int num_events = 1, i; + int num_events = 1; DeviceEvent *event; RawDeviceEvent *raw; double screenx = 0.0, screeny = 0.0; /* desktop coordinate system */ @@ -1258,17 +1282,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, clipValuators(pDev, &mask); - /* store desktop-wide in last.valuators */ - if (valuator_mask_isset(&mask, 0)) - pDev->last.valuators[0] = devx; - if (valuator_mask_isset(&mask, 1)) - pDev->last.valuators[1] = devy; - - for (i = 2; i < valuator_mask_size(&mask); i++) - { - if (valuator_mask_isset(&mask, i)) - pDev->last.valuators[i] = valuator_mask_get_double(&mask, i); - } + storeLastValuators(pDev, &mask, 0, 1, devx, devy); /* Update the MD's co-ordinates, which are always in desktop space. */ if (!IsMaster(pDev) || !IsFloating(pDev)) { |