summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-01-30 16:25:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-02-10 14:26:55 +1000
commit942eae6868b8b0f343b6aa921ddf77e8bb70798a (patch)
tree062651ba5a70ca5c471cb096f1dfed1a1092a4f5 /dix
parentbf044f6d10ad9f2baca91a2f04e82dc1af2657cd (diff)
dix: Remove XineramaCheckPhysLimits.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c104
1 files changed, 44 insertions, 60 deletions
diff --git a/dix/events.c b/dix/events.c
index a3f69780b..c05f27deb 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -216,6 +216,11 @@ Mask DontPropagateMasks[DNPMCOUNT];
static int DontPropagateRefCnts[DNPMCOUNT];
static void CheckVirtualMotion( DeviceIntPtr pDev, QdEventPtr qe, WindowPtr pWin);
+static void CheckPhysLimits(DeviceIntPtr pDev,
+ CursorPtr cursor,
+ Bool generateEvents,
+ Bool confineToScreen,
+ ScreenPtr pScreen);
/**
* Main input device struct.
@@ -472,49 +477,6 @@ XineramaConstrainCursor(DeviceIntPtr pDev)
(* pScreen->ConstrainCursor)(pDev, pScreen, &newBox);
}
-static void
-XineramaCheckPhysLimits(
- DeviceIntPtr pDev,
- CursorPtr cursor,
- Bool generateEvents
-){
- HotSpot new;
- SpritePtr pSprite = pDev->spriteInfo->sprite;
-
- if (!cursor)
- return;
-
- new = pSprite->hotPhys;
-
- /* I don't care what the DDX has to say about it */
- pSprite->physLimits = pSprite->hotLimits;
-
- /* constrain the pointer to those limits */
- if (new.x < pSprite->physLimits.x1)
- new.x = pSprite->physLimits.x1;
- else
- if (new.x >= pSprite->physLimits.x2)
- new.x = pSprite->physLimits.x2 - 1;
- if (new.y < pSprite->physLimits.y1)
- new.y = pSprite->physLimits.y1;
- else
- if (new.y >= pSprite->physLimits.y2)
- new.y = pSprite->physLimits.y2 - 1;
-
- if (pSprite->hotShape) /* more work if the shape is a mess */
- ConfineToShape(pDev, pSprite->hotShape, &new.x, &new.y);
-
- if((new.x != pSprite->hotPhys.x) || (new.y != pSprite->hotPhys.y))
- {
- XineramaSetCursorPosition (pDev, new.x, new.y, generateEvents);
- if (!generateEvents)
- SyntheticMotion(pDev, new.x, new.y);
- }
-
- /* Tell DDX what the limits are */
- XineramaConstrainCursor(pDev);
-}
-
static Bool
XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin)
@@ -585,8 +547,7 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
pSprite->confined = FALSE;
pSprite->confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin;
- XineramaCheckPhysLimits(pDev, pSprite->current,
- generateEvents);
+ CheckPhysLimits(pDev, pSprite->current, generateEvents, FALSE, NULL);
}
@@ -599,7 +560,7 @@ XineramaChangeToCursor(DeviceIntPtr pDev, CursorPtr cursor)
{
if ((pSprite->current->bits->xhot != cursor->bits->xhot) ||
(pSprite->current->bits->yhot != cursor->bits->yhot))
- XineramaCheckPhysLimits(pDev, cursor, FALSE);
+ CheckPhysLimits(pDev, cursor, FALSE, FALSE, NULL);
(*pSprite->screen->DisplayCursor)(pDev, pSprite->screen, cursor);
FreeCursor(pSprite->current, (Cursor)0);
pSprite->current = cursor;
@@ -684,8 +645,8 @@ CheckPhysLimits(
DeviceIntPtr pDev,
CursorPtr cursor,
Bool generateEvents,
- Bool confineToScreen,
- ScreenPtr pScreen)
+ Bool confineToScreen, /* unused if PanoramiX on */
+ ScreenPtr pScreen) /* unused if PanoramiX on */
{
HotSpot new;
SpritePtr pSprite = pDev->spriteInfo->sprite;
@@ -693,14 +654,24 @@ CheckPhysLimits(
if (!cursor)
return;
new = pSprite->hotPhys;
- if (pScreen)
- new.pScreen = pScreen;
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension)
+ /* I don't care what the DDX has to say about it */
+ pSprite->physLimits = pSprite->hotLimits;
else
- pScreen = new.pScreen;
- (*pScreen->CursorLimits) (pDev, pScreen, cursor, &pSprite->hotLimits,
- &pSprite->physLimits);
- pSprite->confined = confineToScreen;
- (* pScreen->ConstrainCursor)(pDev, pScreen, &pSprite->physLimits);
+#endif
+ {
+ if (pScreen)
+ new.pScreen = pScreen;
+ else
+ pScreen = new.pScreen;
+ (*pScreen->CursorLimits) (pDev, pScreen, cursor, &pSprite->hotLimits,
+ &pSprite->physLimits);
+ pSprite->confined = confineToScreen;
+ (* pScreen->ConstrainCursor)(pDev, pScreen, &pSprite->physLimits);
+ }
+
+ /* constrain the pointer to those limits */
if (new.x < pSprite->physLimits.x1)
new.x = pSprite->physLimits.x1;
else
@@ -716,13 +687,26 @@ CheckPhysLimits(
if ((pScreen != pSprite->hotPhys.pScreen) ||
(new.x != pSprite->hotPhys.x) || (new.y != pSprite->hotPhys.y))
{
- if (pScreen != pSprite->hotPhys.pScreen)
- pSprite->hotPhys = new;
- (*pScreen->SetCursorPosition)
- (pDev, pScreen, new.x, new.y, generateEvents);
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension)
+ XineramaSetCursorPosition (pDev, new.x, new.y, generateEvents);
+#endif
+ else
+ {
+ if (pScreen != pSprite->hotPhys.pScreen)
+ pSprite->hotPhys = new;
+ (*pScreen->SetCursorPosition)
+ (pDev, pScreen, new.x, new.y, generateEvents);
+ }
if (!generateEvents)
- SyntheticMotion(pDev, new.x, new.y);
+ SyntheticMotion(pDev, new.x, new.y);
}
+
+#ifdef PANORAMIX
+ /* Tell DDX what the limits are */
+ if (!noPanoramiXExtension)
+ XineramaConstrainCursor(pDev);
+#endif
}
static void