summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-10-01 21:19:11 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-10-02 13:28:01 +1000
commit15b4faff281ad8abce6b32fe2fc855eb6da42476 (patch)
tree366fb22a8bc8a479528a286274d4bbbb97e14270
parent3788113618977bdc83e3ec1e7ca3160bad9a0d13 (diff)
dix: force a minimum of 0 for screen coordinates.
Currently the root coordinates may fall into ]-1..0] if the subpixel remainder is less than 0. Screen coordinates mustn't go below 0, so use miPointerSetPosition to cap off the remainder if the coordinates are below 0. This is cheating a bit, a more comprehensive solution to deal with subpixels correctly when crossing screens is needed. For now, this'll do. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Simon Thum <simon.thum@gmx.de> (cherry picked from commit 45f447dafded5adfe11b7df3325c2d8f6ae0639b)
-rw-r--r--dix/getevents.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index 5224d31eb..2df32e8f5 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -781,6 +781,19 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
*screeny_frac = dev->last.remainder[1];
}
+ /* Hit the left screen edge? */
+ if (*screenx <= 0 && *screenx_frac < 0.0f)
+ {
+ *screenx_frac = 0.0f;
+ x_frac = 0.0f;
+ }
+ if (*screeny <= 0 && *screeny_frac < 0.0f)
+ {
+ *screeny_frac = 0.0f;
+ y_frac = 0.0f;
+ }
+
+
old_screenx = *screenx;
old_screeny = *screeny;
/* This takes care of crossing screens for us, as well as clipping