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.
|
||||
|
||||
|
||||
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
|
||||
|
|
15
dix/events.c
15
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);
|
||||
|
||||
|
|
|
@ -257,6 +257,7 @@ typedef Bool (* UnrealizeFontProcPtr)(
|
|||
FontPtr /*pFont*/);
|
||||
|
||||
typedef void (* ConstrainCursorProcPtr)(
|
||||
DeviceIntPtr /*pDev*/,
|
||||
ScreenPtr /*pScreen*/,
|
||||
BoxPtr /*pBox*/);
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user