summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2006-11-21 14:46:00 +1030
committerPeter Hutterer <whot@hyena.localdomain>2006-11-21 14:46:00 +1030
commit447efdc01d4f8922205ba26e52c9e5ff9f5cb90e (patch)
tree2343da46aa5e2f31a70896c54af7642b1bb63f07
parent1107d8bea22eea26f7b666f1c00a53360b7d237e (diff)
mi: constrain MPX cursors to screen
-rw-r--r--Changelog8
-rw-r--r--dix/events.c15
-rw-r--r--include/scrnintstr.h1
-rw-r--r--mi/mipointer.c15
4 files changed, 34 insertions, 5 deletions
diff --git a/Changelog b/Changelog
index 3477d43ff..80e1846a8 100644
--- a/Changelog
+++ b/Changelog
@@ -24,6 +24,14 @@ Files:
BUG: Core pointer changes whenever MPX cursor changes shape.
+
+mi: constrain MPX cursors to screen
+
+Files:
+ dix/events.c
+ mi/mipointer.c
+ include/scrnintstr.h
+
== 20.11.06 ==
mi: moved core pointer information from miSpriteScreenRec into a
diff --git a/dix/events.c b/dix/events.c
index f50e246e0..4c33fd49e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -392,7 +392,7 @@ XineramaConstrainCursor(void)
newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
- (* pScreen->ConstrainCursor)(pScreen, &newBox);
+ (* pScreen->ConstrainCursor)(inputInfo.pointer, pScreen, &newBox);
}
static void
@@ -735,7 +735,7 @@ CheckPhysLimits(
(*pScreen->CursorLimits) (pScreen, cursor, &sprite.hotLimits,
&sprite.physLimits);
sprite.confined = confineToScreen;
- (* pScreen->ConstrainCursor)(pScreen, &sprite.physLimits);
+ (* pScreen->ConstrainCursor)(inputInfo.pointer, pScreen, &sprite.physLimits);
if (new.x < sprite.physLimits.x1)
new.x = sprite.physLimits.x1;
else
@@ -2118,7 +2118,18 @@ DefineInitialRootWindow(register WindowPtr win)
(*pScreen->CursorLimits) (
pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits);
sprite.confined = FALSE;
+#ifdef MPX
+ {
+ DeviceIntPtr pDev = inputInfo.devices;
+ while(pDev)
+ {
+ (*pScreen->ConstrainCursor) (pDev, pScreen, &sprite.physLimits);
+ pDev = pDev->next;
+ }
+ }
+#else
(*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits);
+#endif
(*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE);
(*pScreen->DisplayCursor) (pScreen, sprite.current);
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 36135153f..4fa2919df 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -257,6 +257,7 @@ typedef Bool (* UnrealizeFontProcPtr)(
FontPtr /*pFont*/);
typedef void (* ConstrainCursorProcPtr)(
+ DeviceIntPtr /*pDev*/,
ScreenPtr /*pScreen*/,
BoxPtr /*pBox*/);
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 8f049c48e..d3f5a5471 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -83,8 +83,10 @@ IsMPDev(DeviceIntPtr pDev)
static Bool miPointerRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
static Bool miPointerUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
static Bool miPointerDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
-static void miPointerConstrainCursor(ScreenPtr pScreen, BoxPtr pBox);
-static void miPointerPointerNonInterestBox(ScreenPtr pScreen, BoxPtr pBox);
+static void miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
+ BoxPtr pBox);
+static void miPointerPointerNonInterestBox(ScreenPtr
+ pScreen, BoxPtr pBox);
static void miPointerCursorLimits(ScreenPtr pScreen, CursorPtr pCursor,
BoxPtr pHotBox, BoxPtr pTopLeftBox);
static Bool miPointerSetCursorPosition(ScreenPtr pScreen, int x, int y,
@@ -254,10 +256,17 @@ miPointerDisplayCursor (pScreen, pCursor)
}
static void
-miPointerConstrainCursor (pScreen, pBox)
+miPointerConstrainCursor (pDev, pScreen, pBox)
+ DeviceIntPtr pDev;
ScreenPtr pScreen;
BoxPtr pBox;
{
+#ifdef MPX
+ if (IsMPDev(pDev))
+ {
+ miMPPointers[pDev->id].limits = *pBox;
+ }
+#endif
miPointer.limits = *pBox;
miPointer.confined = PointerConfinedToScreen();
}