mi: constrain MPX cursors to screen
This commit is contained in:
parent
1107d8bea2
commit
447efdc01d
|
@ -24,6 +24,14 @@ Files:
|
||||||
|
|
||||||
BUG: Core pointer changes whenever MPX cursor changes shape.
|
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 ==
|
== 20.11.06 ==
|
||||||
|
|
||||||
mi: moved core pointer information from miSpriteScreenRec into a
|
mi: moved core pointer information from miSpriteScreenRec into a
|
||||||
|
|
15
dix/events.c
15
dix/events.c
|
@ -392,7 +392,7 @@ XineramaConstrainCursor(void)
|
||||||
newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
|
newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
|
||||||
newBox.y2 += 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
|
static void
|
||||||
|
@ -735,7 +735,7 @@ CheckPhysLimits(
|
||||||
(*pScreen->CursorLimits) (pScreen, cursor, &sprite.hotLimits,
|
(*pScreen->CursorLimits) (pScreen, cursor, &sprite.hotLimits,
|
||||||
&sprite.physLimits);
|
&sprite.physLimits);
|
||||||
sprite.confined = confineToScreen;
|
sprite.confined = confineToScreen;
|
||||||
(* pScreen->ConstrainCursor)(pScreen, &sprite.physLimits);
|
(* pScreen->ConstrainCursor)(inputInfo.pointer, pScreen, &sprite.physLimits);
|
||||||
if (new.x < sprite.physLimits.x1)
|
if (new.x < sprite.physLimits.x1)
|
||||||
new.x = sprite.physLimits.x1;
|
new.x = sprite.physLimits.x1;
|
||||||
else
|
else
|
||||||
|
@ -2118,7 +2118,18 @@ DefineInitialRootWindow(register WindowPtr win)
|
||||||
(*pScreen->CursorLimits) (
|
(*pScreen->CursorLimits) (
|
||||||
pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits);
|
pScreen, sprite.current, &sprite.hotLimits, &sprite.physLimits);
|
||||||
sprite.confined = FALSE;
|
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);
|
(*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits);
|
||||||
|
#endif
|
||||||
(*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE);
|
(*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE);
|
||||||
(*pScreen->DisplayCursor) (pScreen, sprite.current);
|
(*pScreen->DisplayCursor) (pScreen, sprite.current);
|
||||||
|
|
||||||
|
|
|
@ -257,6 +257,7 @@ typedef Bool (* UnrealizeFontProcPtr)(
|
||||||
FontPtr /*pFont*/);
|
FontPtr /*pFont*/);
|
||||||
|
|
||||||
typedef void (* ConstrainCursorProcPtr)(
|
typedef void (* ConstrainCursorProcPtr)(
|
||||||
|
DeviceIntPtr /*pDev*/,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
BoxPtr /*pBox*/);
|
BoxPtr /*pBox*/);
|
||||||
|
|
||||||
|
|
|
@ -83,8 +83,10 @@ IsMPDev(DeviceIntPtr pDev)
|
||||||
static Bool miPointerRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miPointerRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
static Bool miPointerUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miPointerUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
static Bool miPointerDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miPointerDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
static void miPointerConstrainCursor(ScreenPtr pScreen, BoxPtr pBox);
|
static void miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
static void miPointerPointerNonInterestBox(ScreenPtr pScreen, BoxPtr pBox);
|
BoxPtr pBox);
|
||||||
|
static void miPointerPointerNonInterestBox(ScreenPtr
|
||||||
|
pScreen, BoxPtr pBox);
|
||||||
static void miPointerCursorLimits(ScreenPtr pScreen, CursorPtr pCursor,
|
static void miPointerCursorLimits(ScreenPtr pScreen, CursorPtr pCursor,
|
||||||
BoxPtr pHotBox, BoxPtr pTopLeftBox);
|
BoxPtr pHotBox, BoxPtr pTopLeftBox);
|
||||||
static Bool miPointerSetCursorPosition(ScreenPtr pScreen, int x, int y,
|
static Bool miPointerSetCursorPosition(ScreenPtr pScreen, int x, int y,
|
||||||
|
@ -254,10 +256,17 @@ miPointerDisplayCursor (pScreen, pCursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miPointerConstrainCursor (pScreen, pBox)
|
miPointerConstrainCursor (pDev, pScreen, pBox)
|
||||||
|
DeviceIntPtr pDev;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
{
|
{
|
||||||
|
#ifdef MPX
|
||||||
|
if (IsMPDev(pDev))
|
||||||
|
{
|
||||||
|
miMPPointers[pDev->id].limits = *pBox;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
miPointer.limits = *pBox;
|
miPointer.limits = *pBox;
|
||||||
miPointer.confined = PointerConfinedToScreen();
|
miPointer.confined = PointerConfinedToScreen();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue