summaryrefslogtreecommitdiff
path: root/dix/events.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-23 12:57:52 -0700
committerJamey Sharp <jamey@minilop.net>2010-06-03 14:03:23 -0700
commita0456da339fa9b3c3e6fead060338ee7348d6460 (patch)
treea16c3eddfd31a31c41eb6aa975eaceefcfd93d3a /dix/events.c
parenta83cff9f4d622b069c96a68b4e87a669bf1f6446 (diff)
XineramaSetCursorPosition: use screen bounds directly, not POINT_IN_REGION.
This hides a MAXSCREENS-sized array as an implementation detail of panoramiX.c rather than an exported global. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
Diffstat (limited to 'dix/events.c')
-rw-r--r--dix/events.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/dix/events.c b/dix/events.c
index e8e65e2e5..502eebd8d 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -486,6 +486,13 @@ SyntheticMotion(DeviceIntPtr dev, int x, int y) {
static void PostNewCursor(DeviceIntPtr pDev);
static Bool
+pointOnScreen(ScreenPtr pScreen, int x, int y)
+{
+ return x >= pScreen->x && x < pScreen->x + pScreen->width &&
+ y >= pScreen->y && y < pScreen->y + pScreen->height;
+}
+
+static Bool
XineramaSetCursorPosition(
DeviceIntPtr pDev,
int x,
@@ -493,7 +500,6 @@ XineramaSetCursorPosition(
Bool generateEvent
){
ScreenPtr pScreen;
- BoxRec box;
int i;
SpritePtr pSprite = pDev->spriteInfo->sprite;
@@ -505,14 +511,13 @@ XineramaSetCursorPosition(
x += screenInfo.screens[0]->x;
y += screenInfo.screens[0]->y;
- if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
- x, y, &box))
+ if(!pointOnScreen(pScreen, x, y))
{
FOR_NSCREENS(i)
{
if(i == pScreen->myNum)
continue;
- if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box))
+ if(pointOnScreen(screenInfo.screens[i], x, y))
{
pScreen = screenInfo.screens[i];
break;