diff options
author | Thomas Jaeger <ThJaeger@gmail.com> | 2009-06-22 13:00:37 -0400 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-24 09:00:41 +1000 |
commit | 94cdc1ef0a72802573a11ba292e2f5cc8474aa8e (patch) | |
tree | 4fa6cd38b92c1be8e4ad0f872c9bc849df8bcf25 | |
parent | 21cbb4c9de44e2629dc0fa6f647ce2d139f2cef0 (diff) |
dix: deal with first_valuator > 0 correctly if POINTER_SCREEN is set
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | dix/getevents.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index a08d4b2d6..b71e98078 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1050,11 +1050,12 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, if (flags & POINTER_SCREEN) /* valuators are in screen coords */ { - valuators[0] = rescaleValuatorAxis(valuators[0], NULL, - pDev->valuator->axes + 0, - scr->width); - if (num_valuators > 1) - valuators[1] = rescaleValuatorAxis(valuators[1], NULL, + if (num_valuators >= 1 && first_valuator == 0) + valuators[0] = rescaleValuatorAxis(valuators[0], NULL, + pDev->valuator->axes + 0, + scr->width); + if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) + valuators[1 - first_valuator] = rescaleValuatorAxis(valuators[1 - first_valuator], NULL, pDev->valuator->axes + 1, scr->height); } |