diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-12-18 16:09:01 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-12-18 16:09:01 +0000 |
commit | e0d1211591b1caeff41a5ba6567a052c2c634912 (patch) | |
tree | 89ddd2fb66727360ab2df03e397054d15501053e /xserver/randr/rrcrtc.c | |
parent | 47d9c1404905a4c2796c7fbd12a329751e2e3e97 (diff) |
Bugfix Update to xserver 1.11.3
Diffstat (limited to 'xserver/randr/rrcrtc.c')
-rw-r--r-- | xserver/randr/rrcrtc.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/xserver/randr/rrcrtc.c b/xserver/randr/rrcrtc.c index 0437795c4..305a2708e 100644 --- a/xserver/randr/rrcrtc.c +++ b/xserver/randr/rrcrtc.c @@ -1465,7 +1465,7 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, crtc_bounds(crtc, &left, &right, &top, &bottom); - if ((*x >= left) && (*x <= right) && (*y >= top) && (*y <= bottom)) + if ((*x >= left) && (*x < right) && (*y >= top) && (*y < bottom)) return; } @@ -1481,24 +1481,15 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, crtc_bounds(crtc, &left, &right, &top, &bottom); miPointerGetPosition(pDev, &nx, &ny); - if ((nx >= left) && (nx <= right) && (ny >= top) && (ny <= bottom)) { - if ((*x <= left) || (*x >= right)) { - int dx = *x - nx; - - if (dx > 0) - *x = right; - else if (dx < 0) - *x = left; - } - - if ((*y <= top) || (*y >= bottom)) { - int dy = *y - ny; - - if (dy > 0) - *y = bottom; - else if (dy < 0) - *y = top; - } + if ((nx >= left) && (nx < right) && (ny >= top) && (ny < bottom)) { + if (*x < left) + *x = left; + if (*x >= right) + *x = right - 1; + if (*y < top) + *y = top; + if (*y >= bottom) + *y = bottom - 1; return; } |