mi: closing memory leak, miPointer is freed in miPointerCloseScreen
bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX adding DeviceIntPtr parameter to ScreenRec's cursor functions. cleanup of miPointer code to use same scheme in each function dix: MPHasCursor() function determines checking whether to invoke cursor rendering. animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies on the core pointer right now. xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on the core pointer right now. rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on the core pointer right now. ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on the core pointer right now.
This commit is contained in:
parent
f52d53e060
commit
1c7568b8a1
47
Changelog
47
Changelog
|
@ -1,4 +1,49 @@
|
||||||
MPX Changelog file
|
MPX Changelog file
|
||||||
|
== 23.11.06 ==
|
||||||
|
mi: closing memory leak, miPointer is freed in miPointerCloseScreen
|
||||||
|
bugfix: uninitialized pPointer in miPointerGetPosition ifndef MPX
|
||||||
|
adding DeviceIntPtr parameter to ScreenRec's cursor functions.
|
||||||
|
cleanup of miPointer code to use same scheme in each function
|
||||||
|
|
||||||
|
dix: MPHasCursor() function determines checking whether to invoke
|
||||||
|
cursor rendering.
|
||||||
|
|
||||||
|
animcur: adding DeviceIntPtr parameter to cursor functions but animcur relies
|
||||||
|
on the core pointer right now.
|
||||||
|
|
||||||
|
xfixes: adding DeviceIntPtr parameter to cursor functions but xfixes relies on
|
||||||
|
the core pointer right now.
|
||||||
|
|
||||||
|
rac: adding DeviceIntPtr parameter to cursor functions but RAC relies on
|
||||||
|
the core pointer right now.
|
||||||
|
|
||||||
|
ramdac: adding DeviceIntPtr parameter to cursor functions but ramdac relies on
|
||||||
|
the core pointer right now.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
mi/mipointer.c
|
||||||
|
mi/mipointer.h
|
||||||
|
mi/micursor.c
|
||||||
|
mi/mi.h
|
||||||
|
mi/mieq.c
|
||||||
|
include/cursor.h
|
||||||
|
include/inputstr.h
|
||||||
|
include/scrnintstr.h
|
||||||
|
include/dix.h
|
||||||
|
dix/events.c
|
||||||
|
dix/cursor.c
|
||||||
|
Xext/xtest.c
|
||||||
|
render/animcur.c
|
||||||
|
xfixes/cursor.c
|
||||||
|
XTrap/xtrapddmi.c
|
||||||
|
xkb/ddxFakeMtn.c
|
||||||
|
hw/xfree86/common/xf86Cursor.c
|
||||||
|
hw/xfree86/common/xf86RandR.c
|
||||||
|
hw/xfree86/rac/xf86RAC.c
|
||||||
|
hw/xfree86/ramdac/xf86Cursor.c
|
||||||
|
hw/xfree86/dri/dri.c
|
||||||
|
|
||||||
|
|
||||||
== 22.11.06 ==
|
== 22.11.06 ==
|
||||||
|
|
||||||
mi: added DevToSprite() conversion function
|
mi: added DevToSprite() conversion function
|
||||||
|
@ -26,7 +71,7 @@ dix GetSpriteWindow() adjusted for MPX
|
||||||
Files:
|
Files:
|
||||||
Xext/security.c
|
Xext/security.c
|
||||||
Xi/exevents.c
|
Xi/exevents.c
|
||||||
ddx/ddxFakeMtn.c
|
xkb/ddxFakeMtn.c
|
||||||
dix/events.c
|
dix/events.c
|
||||||
include/dix.h
|
include/dix.h
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ SOFTWARE.
|
||||||
# include "extnsionst.h" /* Server ExtensionEntry definitions */
|
# include "extnsionst.h" /* Server ExtensionEntry definitions */
|
||||||
# include "scrnintstr.h" /* Screen struct */
|
# include "scrnintstr.h" /* Screen struct */
|
||||||
#endif
|
#endif
|
||||||
|
#include "inputstr.h"
|
||||||
|
|
||||||
#include <X11/extensions/xtrapdi.h>
|
#include <X11/extensions/xtrapdi.h>
|
||||||
#include <X11/extensions/xtrapddmi.h>
|
#include <X11/extensions/xtrapddmi.h>
|
||||||
|
@ -130,8 +131,8 @@ int XETrapSimulateXEvent(register xXTrapInputReq *request,
|
||||||
{ /* Set new cursor position on screen */
|
{ /* Set new cursor position on screen */
|
||||||
XETrap_avail.data.cur_x = x;
|
XETrap_avail.data.cur_x = x;
|
||||||
XETrap_avail.data.cur_y = y;
|
XETrap_avail.data.cur_y = y;
|
||||||
NewCurrentScreen (pScr, x, y); /* fix from amnonc@mercury.co.il */
|
NewCurrentScreen (inputInfo.pointer, pScr, x, y); /* fix from amnonc@mercury.co.il */
|
||||||
if (!(*pScr->SetCursorPosition)(pScr, x, y, xFalse))
|
if (!(*pScr->SetCursorPosition)(inputInfo.pointer, pScr, x, y, xFalse))
|
||||||
{
|
{
|
||||||
status = BadImplementation;
|
status = BadImplementation;
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,13 +433,13 @@ ProcXTestFakeInput(client)
|
||||||
if (root != GetCurrentRootWindow())
|
if (root != GetCurrentRootWindow())
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
NewCurrentScreen(root->drawable.pScreen,
|
NewCurrentScreen(dev, root->drawable.pScreen,
|
||||||
ev->u.keyButtonPointer.rootX,
|
ev->u.keyButtonPointer.rootX,
|
||||||
ev->u.keyButtonPointer.rootY);
|
ev->u.keyButtonPointer.rootY);
|
||||||
return client->noClientException;
|
return client->noClientException;
|
||||||
}
|
}
|
||||||
(*root->drawable.pScreen->SetCursorPosition)
|
(*root->drawable.pScreen->SetCursorPosition)
|
||||||
(root->drawable.pScreen,
|
(dev, root->drawable.pScreen,
|
||||||
ev->u.keyButtonPointer.rootX,
|
ev->u.keyButtonPointer.rootX,
|
||||||
ev->u.keyButtonPointer.rootY, FALSE);
|
ev->u.keyButtonPointer.rootY, FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
143
dix/cursor.c
143
dix/cursor.c
|
@ -59,6 +59,7 @@ SOFTWARE.
|
||||||
#include "cursorstr.h"
|
#include "cursorstr.h"
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
|
#include "inputstr.h"
|
||||||
|
|
||||||
typedef struct _GlyphShare {
|
typedef struct _GlyphShare {
|
||||||
FontPtr font;
|
FontPtr font;
|
||||||
|
@ -114,14 +115,26 @@ FreeCursor(pointer value, XID cid)
|
||||||
CursorPtr pCurs = (CursorPtr)value;
|
CursorPtr pCurs = (CursorPtr)value;
|
||||||
|
|
||||||
ScreenPtr pscr;
|
ScreenPtr pscr;
|
||||||
|
DeviceIntPtr pDev;
|
||||||
|
|
||||||
if ( --pCurs->refcnt > 0)
|
if ( --pCurs->refcnt > 0)
|
||||||
return(Success);
|
return(Success);
|
||||||
|
|
||||||
|
pDev = inputInfo.pointer;
|
||||||
|
|
||||||
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
||||||
{
|
{
|
||||||
pscr = screenInfo.screens[nscr];
|
pscr = screenInfo.screens[nscr];
|
||||||
(void)( *pscr->UnrealizeCursor)( pscr, pCurs);
|
#ifdef MPX
|
||||||
|
pDev = inputInfo.devices;
|
||||||
|
while(pDev)
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
(void)( *pscr->UnrealizeCursor)(pDev, pscr, pCurs);
|
||||||
|
#ifdef MPX
|
||||||
|
pDev = pDev->next;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
FreeCursorBits(pCurs->bits);
|
FreeCursorBits(pCurs->bits);
|
||||||
xfree( pCurs);
|
xfree( pCurs);
|
||||||
|
@ -171,6 +184,7 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
|
||||||
CursorPtr pCurs;
|
CursorPtr pCurs;
|
||||||
int nscr;
|
int nscr;
|
||||||
ScreenPtr pscr;
|
ScreenPtr pscr;
|
||||||
|
DeviceIntPtr pDev;
|
||||||
|
|
||||||
pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits));
|
pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits));
|
||||||
if (!pCurs)
|
if (!pCurs)
|
||||||
|
@ -207,23 +221,62 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
|
||||||
pCurs->backGreen = backGreen;
|
pCurs->backGreen = backGreen;
|
||||||
pCurs->backBlue = backBlue;
|
pCurs->backBlue = backBlue;
|
||||||
|
|
||||||
|
pDev = inputInfo.pointer;
|
||||||
/*
|
/*
|
||||||
* realize the cursor for every screen
|
* realize the cursor for every screen
|
||||||
*/
|
*/
|
||||||
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
||||||
{
|
{
|
||||||
pscr = screenInfo.screens[nscr];
|
pscr = screenInfo.screens[nscr];
|
||||||
if (!( *pscr->RealizeCursor)( pscr, pCurs))
|
#ifdef MPX
|
||||||
{
|
pDev = inputInfo.devices;
|
||||||
while (--nscr >= 0)
|
while(pDev)
|
||||||
{
|
{
|
||||||
pscr = screenInfo.screens[nscr];
|
if (MPHasCursor(pDev))
|
||||||
( *pscr->UnrealizeCursor)( pscr, pCurs);
|
{
|
||||||
}
|
#endif
|
||||||
FreeCursorBits(bits);
|
if (!( *pscr->RealizeCursor)(pDev, pscr, pCurs))
|
||||||
xfree(pCurs);
|
{
|
||||||
return (CursorPtr)NULL;
|
#ifdef MPX
|
||||||
}
|
/* Realize failed for device pDev on screen pscr.
|
||||||
|
* We have to assume that for all devices before, realize
|
||||||
|
* worked. We need to rollback all devices so far on the
|
||||||
|
* current screen and then all devices on previous
|
||||||
|
* screens.
|
||||||
|
*/
|
||||||
|
DeviceIntPtr pDevIt = inputInfo.devices; /*dev iterator*/
|
||||||
|
while(pDevIt && pDevIt != pDev)
|
||||||
|
{
|
||||||
|
if (MPHasCursor(pDevIt))
|
||||||
|
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
|
||||||
|
pDevIt = pDevIt->next;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
while (--nscr >= 0)
|
||||||
|
{
|
||||||
|
pscr = screenInfo.screens[nscr];
|
||||||
|
#ifdef MPX
|
||||||
|
/* now unrealize all devices on previous screens */
|
||||||
|
pDevIt = inputInfo.devices;
|
||||||
|
while (pDevIt)
|
||||||
|
{
|
||||||
|
if (MPHasCursor(pDevIt))
|
||||||
|
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
|
||||||
|
pDevIt = pDevIt->next;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
( *pscr->UnrealizeCursor)(pDev, pscr, pCurs);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
FreeCursorBits(bits);
|
||||||
|
xfree(pCurs);
|
||||||
|
return (CursorPtr)NULL;
|
||||||
|
}
|
||||||
|
#ifdef MPX
|
||||||
|
}
|
||||||
|
pDev = pDev->next;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return pCurs;
|
return pCurs;
|
||||||
}
|
}
|
||||||
|
@ -260,6 +313,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
||||||
int nscr;
|
int nscr;
|
||||||
ScreenPtr pscr;
|
ScreenPtr pscr;
|
||||||
GlyphSharePtr pShare;
|
GlyphSharePtr pShare;
|
||||||
|
DeviceIntPtr pDev;
|
||||||
|
|
||||||
sourcefont = (FontPtr) SecurityLookupIDByType(client, source, RT_FONT,
|
sourcefont = (FontPtr) SecurityLookupIDByType(client, source, RT_FONT,
|
||||||
SecurityReadAccess);
|
SecurityReadAccess);
|
||||||
|
@ -398,23 +452,62 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
|
||||||
pCurs->backGreen = backGreen;
|
pCurs->backGreen = backGreen;
|
||||||
pCurs->backBlue = backBlue;
|
pCurs->backBlue = backBlue;
|
||||||
|
|
||||||
|
pDev = inputInfo.pointer;
|
||||||
/*
|
/*
|
||||||
* realize the cursor for every screen
|
* realize the cursor for every screen
|
||||||
*/
|
*/
|
||||||
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
|
||||||
{
|
{
|
||||||
pscr = screenInfo.screens[nscr];
|
pscr = screenInfo.screens[nscr];
|
||||||
if (!( *pscr->RealizeCursor)( pscr, pCurs))
|
#ifdef MPX
|
||||||
{
|
pDev = inputInfo.devices;
|
||||||
while (--nscr >= 0)
|
while(pDev)
|
||||||
{
|
{
|
||||||
pscr = screenInfo.screens[nscr];
|
if (MPHasCursor(pDev))
|
||||||
( *pscr->UnrealizeCursor)( pscr, pCurs);
|
{
|
||||||
}
|
#endif
|
||||||
FreeCursorBits(pCurs->bits);
|
if (!( *pscr->RealizeCursor)(pDev, pscr, pCurs))
|
||||||
xfree(pCurs);
|
{
|
||||||
return BadAlloc;
|
#ifdef MPX
|
||||||
}
|
/* Realize failed for device pDev on screen pscr.
|
||||||
|
* We have to assume that for all devices before, realize
|
||||||
|
* worked. We need to rollback all devices so far on the
|
||||||
|
* current screen and then all devices on previous
|
||||||
|
* screens.
|
||||||
|
*/
|
||||||
|
DeviceIntPtr pDevIt = inputInfo.devices; /*dev iterator*/
|
||||||
|
while(pDevIt && pDevIt != pDev)
|
||||||
|
{
|
||||||
|
if (MPHasCursor(pDevIt))
|
||||||
|
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
|
||||||
|
pDevIt = pDevIt->next;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
while (--nscr >= 0)
|
||||||
|
{
|
||||||
|
pscr = screenInfo.screens[nscr];
|
||||||
|
#ifdef MPX
|
||||||
|
/* now unrealize all devices on previous screens */
|
||||||
|
pDevIt = inputInfo.devices;
|
||||||
|
while (pDevIt)
|
||||||
|
{
|
||||||
|
if (MPHasCursor(pDevIt))
|
||||||
|
( *pscr->UnrealizeCursor)(pDevIt, pscr, pCurs);
|
||||||
|
pDevIt = pDevIt->next;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
( *pscr->UnrealizeCursor)(pDev, pscr, pCurs);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
FreeCursorBits(bits);
|
||||||
|
xfree(pCurs);
|
||||||
|
return BadAlloc;
|
||||||
|
}
|
||||||
|
#ifdef MPX
|
||||||
|
}
|
||||||
|
pDev = pDev->next;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
*ppCurs = pCurs;
|
*ppCurs = pCurs;
|
||||||
return Success;
|
return Success;
|
||||||
|
|
120
dix/events.c
120
dix/events.c
|
@ -262,6 +262,19 @@ static SpritePtr sprite; /* info about the cursor sprite */
|
||||||
static SpritePtr mpsprites; /* info about the MPX sprites */
|
static SpritePtr mpsprites; /* info about the MPX sprites */
|
||||||
|
|
||||||
extern BOOL IsMPDev(DeviceIntPtr dev);
|
extern BOOL IsMPDev(DeviceIntPtr dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True for the core pointer and any MPX device.
|
||||||
|
* False for any other device (including keyboards).
|
||||||
|
* Does ID checking for sane range as well.
|
||||||
|
*/
|
||||||
|
_X_EXPORT Bool
|
||||||
|
MPHasCursor(DeviceIntPtr pDev)
|
||||||
|
{
|
||||||
|
return (pDev == inputInfo.pointer ||
|
||||||
|
(pDev->isMPDev && pDev->id < MAX_DEVICES));
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XEVIE
|
#ifdef XEVIE
|
||||||
|
@ -347,6 +360,7 @@ static void PostNewCursor(DeviceIntPtr pDev);
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
XineramaSetCursorPosition(
|
XineramaSetCursorPosition(
|
||||||
|
DeviceIntPtr pDev,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
Bool generateEvent
|
Bool generateEvent
|
||||||
|
@ -354,12 +368,18 @@ XineramaSetCursorPosition(
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
int i;
|
int i;
|
||||||
|
SpritePtr pSprite = sprite;
|
||||||
|
|
||||||
|
#ifdef MPX
|
||||||
|
if (IsMPDev(pDev))
|
||||||
|
pSprite = &mpsprites[pDev->id];
|
||||||
|
#endif
|
||||||
|
|
||||||
/* x,y are in Screen 0 coordinates. We need to decide what Screen
|
/* x,y are in Screen 0 coordinates. We need to decide what Screen
|
||||||
to send the message too and what the coordinates relative to
|
to send the message too and what the coordinates relative to
|
||||||
that screen are. */
|
that screen are. */
|
||||||
|
|
||||||
pScreen = sprite->screen;
|
pScreen = pSprite->screen;
|
||||||
x += panoramiXdataPtr[0].x;
|
x += panoramiXdataPtr[0].x;
|
||||||
y += panoramiXdataPtr[0].y;
|
y += panoramiXdataPtr[0].y;
|
||||||
|
|
||||||
|
@ -378,13 +398,13 @@ XineramaSetCursorPosition(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprite->screen = pScreen;
|
pSprite->screen = pScreen;
|
||||||
sprite->hotPhys.x = x - panoramiXdataPtr[0].x;
|
pSprite->hotPhys.x = x - panoramiXdataPtr[0].x;
|
||||||
sprite->hotPhys.y = y - panoramiXdataPtr[0].y;
|
pSprite->hotPhys.y = y - panoramiXdataPtr[0].y;
|
||||||
x -= panoramiXdataPtr[pScreen->myNum].x;
|
x -= panoramiXdataPtr[pScreen->myNum].x;
|
||||||
y -= panoramiXdataPtr[pScreen->myNum].y;
|
y -= panoramiXdataPtr[pScreen->myNum].y;
|
||||||
|
|
||||||
return (*pScreen->SetCursorPosition)(pScreen, x, y, generateEvent);
|
return (*pScreen->SetCursorPosition)(pDev, pScreen, x, y, generateEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -451,7 +471,7 @@ XineramaCheckPhysLimits(
|
||||||
|
|
||||||
if((new.x != pSprite->hotPhys.x) || (new.y != pSprite->hotPhys.y))
|
if((new.x != pSprite->hotPhys.x) || (new.y != pSprite->hotPhys.y))
|
||||||
{
|
{
|
||||||
XineramaSetCursorPosition (new.x, new.y, generateEvents);
|
XineramaSetCursorPosition (pDev, new.x, new.y, generateEvents);
|
||||||
if (!generateEvents)
|
if (!generateEvents)
|
||||||
SyntheticMotion(new.x, new.y);
|
SyntheticMotion(new.x, new.y);
|
||||||
}
|
}
|
||||||
|
@ -597,7 +617,7 @@ XineramaCheckMotion(xEvent *xE, DeviceIntPtr pDev)
|
||||||
(pSprite->hotPhys.y != XE_KBPTR.rootY))
|
(pSprite->hotPhys.y != XE_KBPTR.rootY))
|
||||||
{
|
{
|
||||||
XineramaSetCursorPosition(
|
XineramaSetCursorPosition(
|
||||||
pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE);
|
pDev, pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE);
|
||||||
}
|
}
|
||||||
XE_KBPTR.rootX = pSprite->hot.x;
|
XE_KBPTR.rootX = pSprite->hot.x;
|
||||||
XE_KBPTR.rootY = pSprite->hot.y;
|
XE_KBPTR.rootY = pSprite->hot.y;
|
||||||
|
@ -693,7 +713,7 @@ XineramaChangeToCursor(DeviceIntPtr pDev, CursorPtr cursor)
|
||||||
if ((pSprite->current->bits->xhot != cursor->bits->xhot) ||
|
if ((pSprite->current->bits->xhot != cursor->bits->xhot) ||
|
||||||
(pSprite->current->bits->yhot != cursor->bits->yhot))
|
(pSprite->current->bits->yhot != cursor->bits->yhot))
|
||||||
XineramaCheckPhysLimits(pDev, cursor, FALSE);
|
XineramaCheckPhysLimits(pDev, cursor, FALSE);
|
||||||
(*pSprite->screen->DisplayCursor)(pSprite->screen, cursor);
|
(*pSprite->screen->DisplayCursor)(pDev, pSprite->screen, cursor);
|
||||||
FreeCursor(pSprite->current, (Cursor)0);
|
FreeCursor(pSprite->current, (Cursor)0);
|
||||||
pSprite->current = cursor;
|
pSprite->current = cursor;
|
||||||
pSprite->current->refcnt++;
|
pSprite->current->refcnt++;
|
||||||
|
@ -785,7 +805,7 @@ CheckPhysLimits(
|
||||||
new.pScreen = pScreen;
|
new.pScreen = pScreen;
|
||||||
else
|
else
|
||||||
pScreen = new.pScreen;
|
pScreen = new.pScreen;
|
||||||
(*pScreen->CursorLimits) (pScreen, cursor, &pSprite->hotLimits,
|
(*pScreen->CursorLimits) (pDev, pScreen, cursor, &pSprite->hotLimits,
|
||||||
&pSprite->physLimits);
|
&pSprite->physLimits);
|
||||||
pSprite->confined = confineToScreen;
|
pSprite->confined = confineToScreen;
|
||||||
(* pScreen->ConstrainCursor)(pDev, pScreen, &pSprite->physLimits);
|
(* pScreen->ConstrainCursor)(pDev, pScreen, &pSprite->physLimits);
|
||||||
|
@ -808,8 +828,9 @@ CheckPhysLimits(
|
||||||
{
|
{
|
||||||
if (pScreen != pSprite->hotPhys.pScreen)
|
if (pScreen != pSprite->hotPhys.pScreen)
|
||||||
pSprite->hotPhys = new;
|
pSprite->hotPhys = new;
|
||||||
(*pScreen->SetCursorPosition) (pScreen, new.x, new.y, generateEvents);
|
(*pScreen->SetCursorPosition)
|
||||||
if (!generateEvents)
|
(pDev, pScreen, new.x, new.y, generateEvents);
|
||||||
|
if (!generateEvents)
|
||||||
SyntheticMotion(new.x, new.y);
|
SyntheticMotion(new.x, new.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -932,8 +953,9 @@ ChangeToCursor(DeviceIntPtr pDev, CursorPtr cursor)
|
||||||
(pSprite->current->bits->yhot != cursor->bits->yhot))
|
(pSprite->current->bits->yhot != cursor->bits->yhot))
|
||||||
CheckPhysLimits(pDev, cursor, FALSE, pSprite->confined,
|
CheckPhysLimits(pDev, cursor, FALSE, pSprite->confined,
|
||||||
(ScreenPtr)NULL);
|
(ScreenPtr)NULL);
|
||||||
(*sprite->hotPhys.pScreen->DisplayCursor) (pSprite->hotPhys.pScreen,
|
(*sprite->hotPhys.pScreen->DisplayCursor) (pDev,
|
||||||
cursor);
|
pSprite->hotPhys.pScreen,
|
||||||
|
cursor);
|
||||||
FreeCursor(pSprite->current, (Cursor)0);
|
FreeCursor(pSprite->current, (Cursor)0);
|
||||||
pSprite->current = cursor;
|
pSprite->current = cursor;
|
||||||
pSprite->current->refcnt++;
|
pSprite->current->refcnt++;
|
||||||
|
@ -2208,10 +2230,9 @@ DefineInitialRootWindow(register WindowPtr win)
|
||||||
{
|
{
|
||||||
register ScreenPtr pScreen = win->drawable.pScreen;
|
register ScreenPtr pScreen = win->drawable.pScreen;
|
||||||
SpritePtr pSprite = sprite;
|
SpritePtr pSprite = sprite;
|
||||||
|
DeviceIntPtr pDev = inputInfo.pointer;
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
int mpSpriteIdx = 0;
|
int mpSpriteIdx = 0;
|
||||||
DeviceIntPtr pDev;
|
|
||||||
|
|
||||||
|
|
||||||
while (mpSpriteIdx < MAX_DEVICES)
|
while (mpSpriteIdx < MAX_DEVICES)
|
||||||
{
|
{
|
||||||
|
@ -2232,7 +2253,7 @@ DefineInitialRootWindow(register WindowPtr win)
|
||||||
pSprite->current->refcnt++;
|
pSprite->current->refcnt++;
|
||||||
spriteTraceGood = 1;
|
spriteTraceGood = 1;
|
||||||
ROOT = win;
|
ROOT = win;
|
||||||
(*pScreen->CursorLimits) ( pScreen, pSprite->current,
|
(*pScreen->CursorLimits) ( pDev, pScreen, pSprite->current,
|
||||||
&pSprite->hotLimits, &pSprite->physLimits);
|
&pSprite->hotLimits, &pSprite->physLimits);
|
||||||
pSprite->confined = FALSE;
|
pSprite->confined = FALSE;
|
||||||
|
|
||||||
|
@ -2241,18 +2262,20 @@ DefineInitialRootWindow(register WindowPtr win)
|
||||||
pDev = inputInfo.devices;
|
pDev = inputInfo.devices;
|
||||||
while(pDev)
|
while(pDev)
|
||||||
{
|
{
|
||||||
if (pDev->id == mpSpriteIdx)
|
if (pDev->id == mpSpriteIdx && MPHasCursor(pDev))
|
||||||
(*pScreen->ConstrainCursor) (pDev, pScreen, &pSprite->physLimits);
|
{
|
||||||
|
#endif
|
||||||
|
(*pScreen->ConstrainCursor) (pDev, pScreen,
|
||||||
|
&pSprite->physLimits);
|
||||||
|
(*pScreen->SetCursorPosition) (pDev, pScreen, pSprite->hot.x,
|
||||||
|
pSprite->hot.y,
|
||||||
|
FALSE);
|
||||||
|
(*pScreen->DisplayCursor) (pDev, pScreen, pSprite->current);
|
||||||
|
#ifdef MPX
|
||||||
|
}
|
||||||
pDev = pDev->next;
|
pDev = pDev->next;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
(*pScreen->ConstrainCursor) (inputInfo.pointer, pScreen,
|
|
||||||
&pSprite->physLimits);
|
|
||||||
#endif
|
#endif
|
||||||
(*pScreen->SetCursorPosition) (pScreen, pSprite->hot.x, pSprite->hot.y,
|
|
||||||
FALSE);
|
|
||||||
(*pScreen->DisplayCursor) (pScreen, pSprite->current);
|
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
if(!noPanoramiXExtension) {
|
if(!noPanoramiXExtension) {
|
||||||
|
@ -2291,35 +2314,43 @@ WindowHasNewCursor(WindowPtr pWin)
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
NewCurrentScreen(ScreenPtr newScreen, int x, int y)
|
NewCurrentScreen(DeviceIntPtr pDev, ScreenPtr newScreen, int x, int y)
|
||||||
{
|
{
|
||||||
sprite->hotPhys.x = x;
|
SpritePtr pSprite = sprite;
|
||||||
sprite->hotPhys.y = y;
|
#ifdef MPX
|
||||||
|
if (IsMPDev(pDev))
|
||||||
|
pSprite = &mpsprites[pDev->id];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pSprite->hotPhys.x = x;
|
||||||
|
pSprite->hotPhys.y = y;
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
if(!noPanoramiXExtension) {
|
if(!noPanoramiXExtension) {
|
||||||
sprite->hotPhys.x += panoramiXdataPtr[newScreen->myNum].x -
|
pSprite->hotPhys.x += panoramiXdataPtr[newScreen->myNum].x -
|
||||||
panoramiXdataPtr[0].x;
|
panoramiXdataPtr[0].x;
|
||||||
sprite->hotPhys.y += panoramiXdataPtr[newScreen->myNum].y -
|
pSprite->hotPhys.y += panoramiXdataPtr[newScreen->myNum].y -
|
||||||
panoramiXdataPtr[0].y;
|
panoramiXdataPtr[0].y;
|
||||||
if (newScreen != sprite->screen) {
|
if (newScreen != pSprite->screen) {
|
||||||
sprite->screen = newScreen;
|
pSprite->screen = newScreen;
|
||||||
/* Make sure we tell the DDX to update its copy of the screen */
|
/* Make sure we tell the DDX to update its copy of the screen */
|
||||||
if(sprite->confineWin)
|
if(pSprite->confineWin)
|
||||||
XineramaConfineCursorToWindow(sprite->confineWin, TRUE);
|
XineramaConfineCursorToWindow(pSprite->confineWin, TRUE);
|
||||||
else
|
else
|
||||||
XineramaConfineCursorToWindow(WindowTable[0], TRUE);
|
XineramaConfineCursorToWindow(WindowTable[0], TRUE);
|
||||||
/* if the pointer wasn't confined, the DDX won't get
|
/* if the pointer wasn't confined, the DDX won't get
|
||||||
told of the pointer warp so we reposition it here */
|
told of the pointer warp so we reposition it here */
|
||||||
if(!syncEvents.playingEvents)
|
if(!syncEvents.playingEvents)
|
||||||
(*sprite->screen->SetCursorPosition)(sprite->screen,
|
(*pSprite->screen->SetCursorPosition)(
|
||||||
sprite->hotPhys.x + panoramiXdataPtr[0].x -
|
pDev,
|
||||||
panoramiXdataPtr[sprite->screen->myNum].x,
|
pSprite->screen,
|
||||||
sprite->hotPhys.y + panoramiXdataPtr[0].y -
|
pSprite->hotPhys.x + panoramiXdataPtr[0].x -
|
||||||
panoramiXdataPtr[sprite->screen->myNum].y, FALSE);
|
panoramiXdataPtr[pSprite->screen->myNum].x,
|
||||||
|
pSprite->hotPhys.y + panoramiXdataPtr[0].y -
|
||||||
|
panoramiXdataPtr[pSprite->screen->myNum].y, FALSE);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
if (newScreen != sprite->hotPhys.pScreen)
|
if (newScreen != pSprite->hotPhys.pScreen)
|
||||||
ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE);
|
ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2430,7 +2461,7 @@ XineramaWarpPointer(ClientPtr client)
|
||||||
if (sprite->hotShape)
|
if (sprite->hotShape)
|
||||||
ConfineToShape(inputInfo.pointer, sprite->hotShape, &x, &y);
|
ConfineToShape(inputInfo.pointer, sprite->hotShape, &x, &y);
|
||||||
|
|
||||||
XineramaSetCursorPosition(x, y, TRUE);
|
XineramaSetCursorPosition(inputInfo.pointer, x, y, TRUE);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -2518,11 +2549,12 @@ ProcWarpPointer(ClientPtr client)
|
||||||
if (sprite->hotShape)
|
if (sprite->hotShape)
|
||||||
ConfineToShape(inputInfo.pointer, sprite->hotShape, &x, &y);
|
ConfineToShape(inputInfo.pointer, sprite->hotShape, &x, &y);
|
||||||
#endif
|
#endif
|
||||||
(*newScreen->SetCursorPosition)(newScreen, x, y, TRUE);
|
(*newScreen->SetCursorPosition)(inputInfo.pointer, newScreen, x, y,
|
||||||
|
TRUE);
|
||||||
}
|
}
|
||||||
else if (!PointerConfinedToScreen(inputInfo.pointer))
|
else if (!PointerConfinedToScreen(inputInfo.pointer))
|
||||||
{
|
{
|
||||||
NewCurrentScreen(newScreen, x, y);
|
NewCurrentScreen(inputInfo.pointer, newScreen, x, y);
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -4693,7 +4725,7 @@ ProcRecolorCursor(ClientPtr client)
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
displayed = (pscr == sprite->hotPhys.pScreen);
|
displayed = (pscr == sprite->hotPhys.pScreen);
|
||||||
( *pscr->RecolorCursor)(pscr, pCursor,
|
( *pscr->RecolorCursor)(inputInfo.pointer, pscr, pCursor,
|
||||||
(pCursor == sprite->current) && displayed);
|
(pCursor == sprite->current) && displayed);
|
||||||
}
|
}
|
||||||
return (Success);
|
return (Success);
|
||||||
|
|
|
@ -69,7 +69,7 @@ typedef struct {
|
||||||
|
|
||||||
static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y);
|
static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y);
|
||||||
static void xf86CrossScreen(ScreenPtr pScreen, Bool entering);
|
static void xf86CrossScreen(ScreenPtr pScreen, Bool entering);
|
||||||
static void xf86WarpCursor(ScreenPtr pScreen, int x, int y);
|
static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
|
||||||
|
|
||||||
static void xf86PointerMoved(int scrnIndex, int x, int y);
|
static void xf86PointerMoved(int scrnIndex, int x, int y);
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
|
||||||
(*pScr->AdjustFrame)(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0);
|
(*pScr->AdjustFrame)(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0);
|
||||||
|
|
||||||
if (pScreen == pCursorScreen)
|
if (pScreen == pCursorScreen)
|
||||||
xf86WarpCursor(pScreen, px, py);
|
xf86WarpCursor(inputInfo.pointer, pScreen, px, py);
|
||||||
|
|
||||||
return Switched;
|
return Switched;
|
||||||
}
|
}
|
||||||
|
@ -430,11 +430,11 @@ xf86CrossScreen (ScreenPtr pScreen, Bool entering)
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
xf86WarpCursor (ScreenPtr pScreen, int x, int y)
|
xf86WarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||||
{
|
{
|
||||||
int sigstate;
|
int sigstate;
|
||||||
sigstate = xf86BlockSIGIO ();
|
sigstate = xf86BlockSIGIO ();
|
||||||
miPointerWarpCursor(pScreen,x,y);
|
miPointerWarpCursor(pDev, pScreen,x,y);
|
||||||
|
|
||||||
xf86Info.currentScreen = pScreen;
|
xf86Info.currentScreen = pScreen;
|
||||||
xf86UnblockSIGIO (sigstate);
|
xf86UnblockSIGIO (sigstate);
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "xf86DDC.h"
|
#include "xf86DDC.h"
|
||||||
#include "mipointer.h"
|
#include "mipointer.h"
|
||||||
#include <randrstr.h>
|
#include <randrstr.h>
|
||||||
|
#include "inputstr.h"
|
||||||
|
|
||||||
typedef struct _xf86RandRInfo {
|
typedef struct _xf86RandRInfo {
|
||||||
CreateScreenResourcesProcPtr CreateScreenResources;
|
CreateScreenResourcesProcPtr CreateScreenResources;
|
||||||
|
@ -291,7 +292,7 @@ xf86RandRSetConfig (ScreenPtr pScreen,
|
||||||
|
|
||||||
xf86SetViewport(pScreen, px, py);
|
xf86SetViewport(pScreen, px, py);
|
||||||
|
|
||||||
(*pScreen->SetCursorPosition) (pScreen, px, py, FALSE);
|
(*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -70,6 +70,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
#include "mipointer.h"
|
#include "mipointer.h"
|
||||||
#include "xf86_OSproc.h"
|
#include "xf86_OSproc.h"
|
||||||
|
#include "inputstr.h"
|
||||||
|
|
||||||
#if !defined(PANORAMIX)
|
#if !defined(PANORAMIX)
|
||||||
extern Bool noPanoramiXExtension;
|
extern Bool noPanoramiXExtension;
|
||||||
|
@ -2013,7 +2014,7 @@ DRIAdjustFrame(int scrnIndex, int x, int y, int flags)
|
||||||
if (px > pScrn->frameX1) px = pScrn->frameX1;
|
if (px > pScrn->frameX1) px = pScrn->frameX1;
|
||||||
if (py < pScrn->frameY0) py = pScrn->frameY0;
|
if (py < pScrn->frameY0) py = pScrn->frameY0;
|
||||||
if (py > pScrn->frameY1) py = pScrn->frameY1;
|
if (py > pScrn->frameY1) py = pScrn->frameY1;
|
||||||
pScreen->SetCursorPosition(pScreen, px, py, TRUE);
|
pScreen->SetCursorPosition(inputInfo.pointer, pScreen, px, py, TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,13 +154,16 @@ static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth);
|
||||||
static Bool RACCreateGC(GCPtr pGC);
|
static Bool RACCreateGC(GCPtr pGC);
|
||||||
static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank);
|
static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank);
|
||||||
static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
|
static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
|
||||||
static void RACRecolorCursor (ScreenPtr pScreen, CursorPtr pCurs,
|
static void RACRecolorCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
Bool displayed);
|
CursorPtr pCurs, Bool displayed);
|
||||||
static Bool RACRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool RACRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
static Bool RACUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor);
|
CursorPtr pCursor);
|
||||||
static Bool RACDisplayCursor (ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool RACUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
static Bool RACSetCursorPosition (ScreenPtr pScreen, int x, int y,
|
CursorPtr pCursor);
|
||||||
Bool generateEvent);
|
static Bool RACDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
CursorPtr pCursor);
|
||||||
|
static Bool RACSetCursorPosition (DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
int x, int y, Bool generateEvent);
|
||||||
static void RACAdjustFrame(int index, int x, int y, int flags);
|
static void RACAdjustFrame(int index, int x, int y, int flags);
|
||||||
static Bool RACSwitchMode(int index, DisplayModePtr mode, int flags);
|
static Bool RACSwitchMode(int index, DisplayModePtr mode, int flags);
|
||||||
static Bool RACEnterVT(int index, int flags);
|
static Bool RACEnterVT(int index, int flags);
|
||||||
|
@ -586,6 +589,7 @@ RACStoreColors (
|
||||||
|
|
||||||
static void
|
static void
|
||||||
RACRecolorCursor (
|
RACRecolorCursor (
|
||||||
|
DeviceIntPtr pDev,
|
||||||
ScreenPtr pScreen,
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCurs,
|
CursorPtr pCurs,
|
||||||
Bool displayed
|
Bool displayed
|
||||||
|
@ -594,15 +598,16 @@ RACRecolorCursor (
|
||||||
DPRINT_S("RACRecolorCursor",pScreen->myNum);
|
DPRINT_S("RACRecolorCursor",pScreen->myNum);
|
||||||
SCREEN_PROLOG (RecolorCursor);
|
SCREEN_PROLOG (RecolorCursor);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
(*pScreen->RecolorCursor) (pScreen,pCurs,displayed);
|
(*pScreen->RecolorCursor) (pDev, pScreen,pCurs,displayed);
|
||||||
|
|
||||||
SCREEN_EPILOG ( RecolorCursor, RACRecolorCursor);
|
SCREEN_EPILOG ( RecolorCursor, RACRecolorCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
RACRealizeCursor (
|
RACRealizeCursor (
|
||||||
ScreenPtr pScreen,
|
DeviceIntPtr pDev,
|
||||||
CursorPtr pCursor
|
ScreenPtr pScreen,
|
||||||
|
CursorPtr pCursor
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Bool val;
|
Bool val;
|
||||||
|
@ -610,7 +615,7 @@ RACRealizeCursor (
|
||||||
DPRINT_S("RACRealizeCursor",pScreen->myNum);
|
DPRINT_S("RACRealizeCursor",pScreen->myNum);
|
||||||
SCREEN_PROLOG (RealizeCursor);
|
SCREEN_PROLOG (RealizeCursor);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
val = (*pScreen->RealizeCursor) (pScreen,pCursor);
|
val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor);
|
||||||
|
|
||||||
SCREEN_EPILOG ( RealizeCursor, RACRealizeCursor);
|
SCREEN_EPILOG ( RealizeCursor, RACRealizeCursor);
|
||||||
return val;
|
return val;
|
||||||
|
@ -618,8 +623,9 @@ RACRealizeCursor (
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
RACUnrealizeCursor (
|
RACUnrealizeCursor (
|
||||||
ScreenPtr pScreen,
|
DeviceIntPtr pDev,
|
||||||
CursorPtr pCursor
|
ScreenPtr pScreen,
|
||||||
|
CursorPtr pCursor
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Bool val;
|
Bool val;
|
||||||
|
@ -627,7 +633,7 @@ RACUnrealizeCursor (
|
||||||
DPRINT_S("RACUnrealizeCursor",pScreen->myNum);
|
DPRINT_S("RACUnrealizeCursor",pScreen->myNum);
|
||||||
SCREEN_PROLOG (UnrealizeCursor);
|
SCREEN_PROLOG (UnrealizeCursor);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
val = (*pScreen->UnrealizeCursor) (pScreen,pCursor);
|
val = (*pScreen->UnrealizeCursor) (pDev, pScreen,pCursor);
|
||||||
|
|
||||||
SCREEN_EPILOG ( UnrealizeCursor, RACUnrealizeCursor);
|
SCREEN_EPILOG ( UnrealizeCursor, RACUnrealizeCursor);
|
||||||
return val;
|
return val;
|
||||||
|
@ -635,8 +641,9 @@ RACUnrealizeCursor (
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
RACDisplayCursor (
|
RACDisplayCursor (
|
||||||
ScreenPtr pScreen,
|
DeviceIntPtr pDev,
|
||||||
CursorPtr pCursor
|
ScreenPtr pScreen,
|
||||||
|
CursorPtr pCursor
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Bool val;
|
Bool val;
|
||||||
|
@ -644,7 +651,7 @@ RACDisplayCursor (
|
||||||
DPRINT_S("RACDisplayCursor",pScreen->myNum);
|
DPRINT_S("RACDisplayCursor",pScreen->myNum);
|
||||||
SCREEN_PROLOG (DisplayCursor);
|
SCREEN_PROLOG (DisplayCursor);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
val = (*pScreen->DisplayCursor) (pScreen,pCursor);
|
val = (*pScreen->DisplayCursor) (pDev, pScreen,pCursor);
|
||||||
|
|
||||||
SCREEN_EPILOG ( DisplayCursor, RACDisplayCursor);
|
SCREEN_EPILOG ( DisplayCursor, RACDisplayCursor);
|
||||||
return val;
|
return val;
|
||||||
|
@ -652,6 +659,7 @@ RACDisplayCursor (
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
RACSetCursorPosition (
|
RACSetCursorPosition (
|
||||||
|
DeviceIntPtr pDev,
|
||||||
ScreenPtr pScreen,
|
ScreenPtr pScreen,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
Bool generateEvent)
|
Bool generateEvent)
|
||||||
|
@ -661,7 +669,7 @@ RACSetCursorPosition (
|
||||||
DPRINT_S("RACSetCursorPosition",pScreen->myNum);
|
DPRINT_S("RACSetCursorPosition",pScreen->myNum);
|
||||||
SCREEN_PROLOG (SetCursorPosition);
|
SCREEN_PROLOG (SetCursorPosition);
|
||||||
ENABLE;
|
ENABLE;
|
||||||
val = (*pScreen->SetCursorPosition) (pScreen,x,y,generateEvent);
|
val = (*pScreen->SetCursorPosition) (pDev, pScreen,x,y,generateEvent);
|
||||||
|
|
||||||
SCREEN_EPILOG ( SetCursorPosition, RACSetCursorPosition);
|
SCREEN_EPILOG ( SetCursorPosition, RACSetCursorPosition);
|
||||||
return val;
|
return val;
|
||||||
|
|
|
@ -38,7 +38,7 @@ static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
|
||||||
/* Screen functions */
|
/* Screen functions */
|
||||||
|
|
||||||
static void xf86CursorInstallColormap(ColormapPtr);
|
static void xf86CursorInstallColormap(ColormapPtr);
|
||||||
static void xf86CursorRecolorCursor(ScreenPtr, CursorPtr, Bool);
|
static void xf86CursorRecolorCursor(DeviceIntPtr pDev, ScreenPtr, CursorPtr, Bool);
|
||||||
static Bool xf86CursorCloseScreen(int, ScreenPtr);
|
static Bool xf86CursorCloseScreen(int, ScreenPtr);
|
||||||
static void xf86CursorQueryBestSize(int, unsigned short*, unsigned short*,
|
static void xf86CursorQueryBestSize(int, unsigned short*, unsigned short*,
|
||||||
ScreenPtr);
|
ScreenPtr);
|
||||||
|
@ -181,6 +181,7 @@ xf86CursorInstallColormap(ColormapPtr pMap)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xf86CursorRecolorCursor(
|
xf86CursorRecolorCursor(
|
||||||
|
DeviceIntPtr pDev,
|
||||||
ScreenPtr pScreen,
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCurs,
|
CursorPtr pCurs,
|
||||||
Bool displayed)
|
Bool displayed)
|
||||||
|
@ -192,7 +193,7 @@ xf86CursorRecolorCursor(
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ScreenPriv->SWCursor)
|
if (ScreenPriv->SWCursor)
|
||||||
(*ScreenPriv->RecolorCursor)(pScreen, pCurs, displayed);
|
(*ScreenPriv->RecolorCursor)(pDev, pScreen, pCurs, displayed);
|
||||||
else
|
else
|
||||||
xf86RecolorCursor(pScreen, pCurs, displayed);
|
xf86RecolorCursor(pScreen, pCurs, displayed);
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,6 +131,7 @@ extern void CheckCursorConfinement(
|
||||||
WindowPtr /*pWin*/);
|
WindowPtr /*pWin*/);
|
||||||
|
|
||||||
extern void NewCurrentScreen(
|
extern void NewCurrentScreen(
|
||||||
|
struct _DeviceIntRec* /*pDev*/,
|
||||||
ScreenPtr /*newScreen*/,
|
ScreenPtr /*newScreen*/,
|
||||||
int /*x*/,
|
int /*x*/,
|
||||||
int /*y*/);
|
int /*y*/);
|
||||||
|
|
|
@ -821,4 +821,8 @@ extern int xstrcasecmp(char *s1, char *s2);
|
||||||
/* ffs.c */
|
/* ffs.c */
|
||||||
extern int ffs(int i);
|
extern int ffs(int i);
|
||||||
|
|
||||||
|
#ifdef MPX
|
||||||
|
extern Bool MPHasCursor(DeviceIntPtr pDev);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* DIX_H */
|
#endif /* DIX_H */
|
||||||
|
|
|
@ -330,7 +330,7 @@ typedef struct _DeviceIntRec {
|
||||||
int nPrivates;
|
int nPrivates;
|
||||||
DeviceUnwrapProc unwrapProc;
|
DeviceUnwrapProc unwrapProc;
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
Bool isMPDev; /* TRUE if multipointer device */
|
Bool isMPDev; /* TRUE if multipointer device */
|
||||||
#endif
|
#endif
|
||||||
} DeviceIntRec;
|
} DeviceIntRec;
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ typedef void (* GetSpansProcPtr)(
|
||||||
char * /*pdstStart*/);
|
char * /*pdstStart*/);
|
||||||
|
|
||||||
typedef void (* PointerNonInterestBoxProcPtr)(
|
typedef void (* PointerNonInterestBoxProcPtr)(
|
||||||
|
DeviceIntPtr /*pDev*/,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
BoxPtr /*pBox*/);
|
BoxPtr /*pBox*/);
|
||||||
|
|
||||||
|
@ -262,29 +263,35 @@ typedef void (* ConstrainCursorProcPtr)(
|
||||||
BoxPtr /*pBox*/);
|
BoxPtr /*pBox*/);
|
||||||
|
|
||||||
typedef void (* CursorLimitsProcPtr)(
|
typedef void (* CursorLimitsProcPtr)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
CursorPtr /*pCursor*/,
|
CursorPtr /*pCursor*/,
|
||||||
BoxPtr /*pHotBox*/,
|
BoxPtr /*pHotBox*/,
|
||||||
BoxPtr /*pTopLeftBox*/);
|
BoxPtr /*pTopLeftBox*/);
|
||||||
|
|
||||||
typedef Bool (* DisplayCursorProcPtr)(
|
typedef Bool (* DisplayCursorProcPtr)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
CursorPtr /*pCursor*/);
|
CursorPtr /*pCursor*/);
|
||||||
|
|
||||||
typedef Bool (* RealizeCursorProcPtr)(
|
typedef Bool (* RealizeCursorProcPtr)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
CursorPtr /*pCursor*/);
|
CursorPtr /*pCursor*/);
|
||||||
|
|
||||||
typedef Bool (* UnrealizeCursorProcPtr)(
|
typedef Bool (* UnrealizeCursorProcPtr)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
CursorPtr /*pCursor*/);
|
CursorPtr /*pCursor*/);
|
||||||
|
|
||||||
typedef void (* RecolorCursorProcPtr)(
|
typedef void (* RecolorCursorProcPtr)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
CursorPtr /*pCursor*/,
|
CursorPtr /*pCursor*/,
|
||||||
Bool /*displayed*/);
|
Bool /*displayed*/);
|
||||||
|
|
||||||
typedef Bool (* SetCursorPositionProcPtr)(
|
typedef Bool (* SetCursorPositionProcPtr)(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
int /*x*/,
|
int /*x*/,
|
||||||
int /*y*/,
|
int /*y*/,
|
||||||
|
|
1
mi/mi.h
1
mi/mi.h
|
@ -137,6 +137,7 @@ extern void miPutImage(
|
||||||
/* micursor.c */
|
/* micursor.c */
|
||||||
|
|
||||||
extern void miRecolorCursor(
|
extern void miRecolorCursor(
|
||||||
|
DeviceIntPtr /* pDev */,
|
||||||
ScreenPtr /*pScr*/,
|
ScreenPtr /*pScr*/,
|
||||||
CursorPtr /*pCurs*/,
|
CursorPtr /*pCurs*/,
|
||||||
Bool /*displayed*/
|
Bool /*displayed*/
|
||||||
|
|
|
@ -52,24 +52,26 @@ SOFTWARE.
|
||||||
#include "cursor.h"
|
#include "cursor.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
#include "inputstr.h"
|
||||||
|
|
||||||
extern Bool Must_have_memory;
|
extern Bool Must_have_memory;
|
||||||
|
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
miRecolorCursor( pScr, pCurs, displayed)
|
miRecolorCursor( pDev, pScr, pCurs, displayed)
|
||||||
ScreenPtr pScr;
|
DeviceIntPtr pDev;
|
||||||
CursorPtr pCurs;
|
ScreenPtr pScr;
|
||||||
Bool displayed;
|
CursorPtr pCurs;
|
||||||
|
Bool displayed;
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* This is guaranteed to correct any color-dependent state which may have
|
* This is guaranteed to correct any color-dependent state which may have
|
||||||
* been bound up in private state created by RealizeCursor
|
* been bound up in private state created by RealizeCursor
|
||||||
*/
|
*/
|
||||||
(* pScr->UnrealizeCursor)( pScr, pCurs);
|
(* pScr->UnrealizeCursor)( pDev, pScr, pCurs);
|
||||||
Must_have_memory = TRUE; /* XXX */
|
Must_have_memory = TRUE; /* XXX */
|
||||||
(* pScr->RealizeCursor)( pScr, pCurs);
|
(* pScr->RealizeCursor)( pDev, pScr, pCurs);
|
||||||
Must_have_memory = FALSE; /* XXX */
|
Must_have_memory = FALSE; /* XXX */
|
||||||
if ( displayed)
|
if ( displayed)
|
||||||
(* pScr->DisplayCursor)( pScr, pCurs);
|
(* pScr->DisplayCursor)( pDev, pScr, pCurs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,7 @@ mieqProcessInputEvents()
|
||||||
miEventQueue.head = 0;
|
miEventQueue.head = 0;
|
||||||
else
|
else
|
||||||
++miEventQueue.head;
|
++miEventQueue.head;
|
||||||
NewCurrentScreen (miEventQueue.pDequeueScreen, x, y);
|
NewCurrentScreen (e->pDev, miEventQueue.pDequeueScreen, x, y);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (miEventQueue.head == QUEUE_SIZE - 1)
|
if (miEventQueue.head == QUEUE_SIZE - 1)
|
||||||
|
|
253
mi/mipointer.c
253
mi/mipointer.c
|
@ -68,7 +68,9 @@ static unsigned long miPointerGeneration = 0;
|
||||||
static miPointerPtr miPointer;
|
static miPointerPtr miPointer;
|
||||||
|
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
/* Multipointers */
|
/* Multipointers
|
||||||
|
* ID of a device == index in this array.
|
||||||
|
*/
|
||||||
static miPointerRec miMPPointers[MAX_DEVICES];
|
static miPointerRec miMPPointers[MAX_DEVICES];
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,19 +82,26 @@ IsMPDev(DeviceIntPtr pDev)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Bool miPointerRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
static Bool miPointerUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
CursorPtr pCursor);
|
||||||
static Bool miPointerDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
static Bool miPointerUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
CursorPtr pCursor);
|
||||||
|
static Bool miPointerDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
CursorPtr pCursor);
|
||||||
static void miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
static void miPointerConstrainCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
BoxPtr pBox);
|
BoxPtr pBox);
|
||||||
static void miPointerPointerNonInterestBox(ScreenPtr
|
static void miPointerPointerNonInterestBox(DeviceIntPtr pDev,
|
||||||
pScreen, BoxPtr pBox);
|
ScreenPtr pScreen, BoxPtr pBox);
|
||||||
static void miPointerCursorLimits(ScreenPtr pScreen, CursorPtr pCursor,
|
static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
BoxPtr pHotBox, BoxPtr pTopLeftBox);
|
CursorPtr pCursor, BoxPtr pHotBox,
|
||||||
static Bool miPointerSetCursorPosition(ScreenPtr pScreen, int x, int y,
|
BoxPtr pTopLeftBox);
|
||||||
|
static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
int x, int y,
|
||||||
Bool generateEvent);
|
Bool generateEvent);
|
||||||
static Bool miPointerCloseScreen(int index, ScreenPtr pScreen);
|
static Bool miPointerCloseScreen(int index, ScreenPtr pScreen);
|
||||||
static void miPointerMove(ScreenPtr pScreen, int x, int y, unsigned long time);
|
static void miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen,
|
||||||
|
int x, int y,
|
||||||
|
unsigned long time);
|
||||||
|
|
||||||
_X_EXPORT Bool
|
_X_EXPORT Bool
|
||||||
miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
||||||
|
@ -101,9 +110,6 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
||||||
miPointerScreenFuncPtr screenFuncs;
|
miPointerScreenFuncPtr screenFuncs;
|
||||||
Bool waitForUpdate;
|
Bool waitForUpdate;
|
||||||
{
|
{
|
||||||
#ifdef MPX
|
|
||||||
int mpPtrIdx = 0; /* loop counter */
|
|
||||||
#endif
|
|
||||||
miPointerScreenPtr pScreenPriv;
|
miPointerScreenPtr pScreenPriv;
|
||||||
|
|
||||||
if (miPointerGeneration != serverGeneration)
|
if (miPointerGeneration != serverGeneration)
|
||||||
|
@ -147,7 +153,7 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
||||||
miPointer = (miPointerPtr)xalloc(sizeof(miPointerRec));
|
miPointer = (miPointerPtr)xalloc(sizeof(miPointerRec));
|
||||||
if (!miPointer)
|
if (!miPointer)
|
||||||
{
|
{
|
||||||
xfree(pScreenPriv);
|
xfree((pointer)pScreenPriv);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
miPointer->pScreen = NULL;
|
miPointer->pScreen = NULL;
|
||||||
|
@ -165,23 +171,26 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
xfree(miPointer);
|
xfree(miPointer);
|
||||||
miPointer = &miMPPointers[1];
|
miPointer = &miMPPointers[1];
|
||||||
/*
|
|
||||||
* Set up pointer objects for multipointer devices.
|
|
||||||
*/
|
|
||||||
while(mpPtrIdx < MAX_DEVICES)
|
|
||||||
{
|
{
|
||||||
miMPPointers[mpPtrIdx].pScreen = NULL;
|
int mpPtrIdx = 0; /* loop counter */
|
||||||
miMPPointers[mpPtrIdx].pSpriteScreen = NULL;
|
/*
|
||||||
miMPPointers[mpPtrIdx].pCursor = NULL;
|
* Set up pointer objects for multipointer devices.
|
||||||
miMPPointers[mpPtrIdx].pSpriteCursor = NULL;
|
*/
|
||||||
miMPPointers[mpPtrIdx].limits.x1 = 0;
|
while(mpPtrIdx < MAX_DEVICES)
|
||||||
miMPPointers[mpPtrIdx].limits.x2 = 32767;
|
{
|
||||||
miMPPointers[mpPtrIdx].limits.y1 = 0;
|
miMPPointers[mpPtrIdx].pScreen = NULL;
|
||||||
miMPPointers[mpPtrIdx].limits.y2 = 32767;
|
miMPPointers[mpPtrIdx].pSpriteScreen = NULL;
|
||||||
miMPPointers[mpPtrIdx].confined = FALSE;
|
miMPPointers[mpPtrIdx].pCursor = NULL;
|
||||||
miMPPointers[mpPtrIdx].x = 0;
|
miMPPointers[mpPtrIdx].pSpriteCursor = NULL;
|
||||||
miMPPointers[mpPtrIdx].y = 0;
|
miMPPointers[mpPtrIdx].limits.x1 = 0;
|
||||||
mpPtrIdx++;
|
miMPPointers[mpPtrIdx].limits.x2 = 32767;
|
||||||
|
miMPPointers[mpPtrIdx].limits.y1 = 0;
|
||||||
|
miMPPointers[mpPtrIdx].limits.y2 = 32767;
|
||||||
|
miMPPointers[mpPtrIdx].confined = FALSE;
|
||||||
|
miMPPointers[mpPtrIdx].x = 0;
|
||||||
|
miMPPointers[mpPtrIdx].y = 0;
|
||||||
|
mpPtrIdx++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -196,10 +205,6 @@ miPointerCloseScreen (index, pScreen)
|
||||||
int mpPointerIdx = 0;
|
int mpPointerIdx = 0;
|
||||||
SetupScreen(pScreen);
|
SetupScreen(pScreen);
|
||||||
|
|
||||||
if (pScreen == miPointer->pScreen)
|
|
||||||
miPointer->pScreen = 0;
|
|
||||||
if (pScreen == miPointer->pSpriteScreen)
|
|
||||||
miPointer->pSpriteScreen = 0;
|
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
while(mpPointerIdx < MAX_DEVICES)
|
while(mpPointerIdx < MAX_DEVICES)
|
||||||
{
|
{
|
||||||
|
@ -209,6 +214,12 @@ miPointerCloseScreen (index, pScreen)
|
||||||
miMPPointers[mpPointerIdx].pSpriteScreen = 0;
|
miMPPointers[mpPointerIdx].pSpriteScreen = 0;
|
||||||
mpPointerIdx++;
|
mpPointerIdx++;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (pScreen == miPointer->pScreen)
|
||||||
|
miPointer->pScreen = 0;
|
||||||
|
if (pScreen == miPointer->pSpriteScreen)
|
||||||
|
miPointer->pSpriteScreen = 0;
|
||||||
|
xfree((pointer)miPointer);
|
||||||
#endif
|
#endif
|
||||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
||||||
xfree ((pointer) pScreenPriv);
|
xfree ((pointer) pScreenPriv);
|
||||||
|
@ -220,67 +231,44 @@ miPointerCloseScreen (index, pScreen)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
miPointerRealizeCursor (pScreen, pCursor)
|
miPointerRealizeCursor (pDev, pScreen, pCursor)
|
||||||
ScreenPtr pScreen;
|
DeviceIntPtr pDev;
|
||||||
CursorPtr pCursor;
|
ScreenPtr pScreen;
|
||||||
|
CursorPtr pCursor;
|
||||||
{
|
{
|
||||||
DeviceIntPtr pDev = inputInfo.pointer;
|
|
||||||
|
|
||||||
SetupScreen(pScreen);
|
SetupScreen(pScreen);
|
||||||
#ifdef MPX
|
|
||||||
pDev = inputInfo.devices;
|
|
||||||
while(pDev)
|
|
||||||
{
|
|
||||||
if (pDev != inputInfo.keyboard)
|
|
||||||
(*pScreenPriv->spriteFuncs->RealizeCursor) (pDev, pScreen, pCursor);
|
|
||||||
pDev = pDev->next;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
#else
|
|
||||||
return (*pScreenPriv->spriteFuncs->RealizeCursor) (pDev, pScreen, pCursor);
|
return (*pScreenPriv->spriteFuncs->RealizeCursor) (pDev, pScreen, pCursor);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
miPointerUnrealizeCursor (pScreen, pCursor)
|
miPointerUnrealizeCursor (pDev, pScreen, pCursor)
|
||||||
ScreenPtr pScreen;
|
DeviceIntPtr pDev;
|
||||||
CursorPtr pCursor;
|
ScreenPtr pScreen;
|
||||||
|
CursorPtr pCursor;
|
||||||
{
|
{
|
||||||
DeviceIntPtr pDev = inputInfo.pointer;
|
|
||||||
SetupScreen(pScreen);
|
SetupScreen(pScreen);
|
||||||
|
|
||||||
#ifdef MPX
|
|
||||||
pDev = inputInfo.devices;
|
|
||||||
while(pDev)
|
|
||||||
{
|
|
||||||
if (pDev != inputInfo.keyboard)
|
|
||||||
(*pScreenPriv->spriteFuncs->UnrealizeCursor) (pDev, pScreen, pCursor);
|
|
||||||
pDev = pDev->next;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
#else
|
|
||||||
return (*pScreenPriv->spriteFuncs->UnrealizeCursor) (pDev, pScreen, pCursor);
|
return (*pScreenPriv->spriteFuncs->UnrealizeCursor) (pDev, pScreen, pCursor);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
miPointerDisplayCursor (pScreen, pCursor)
|
miPointerDisplayCursor (pDev, pScreen, pCursor)
|
||||||
ScreenPtr pScreen;
|
DeviceIntPtr pDev;
|
||||||
CursorPtr pCursor;
|
ScreenPtr pScreen;
|
||||||
|
CursorPtr pCursor;
|
||||||
{
|
{
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
int mpPtrIdx = 0;
|
/* use core pointer for non MPX devices */
|
||||||
while (mpPtrIdx < MAX_DEVICES)
|
if (!IsMPDev(pDev))
|
||||||
{
|
pDev = inputInfo.pointer;
|
||||||
miMPPointers[mpPtrIdx].pCursor = pCursor;
|
|
||||||
miMPPointers[mpPtrIdx].pScreen = pScreen;
|
|
||||||
mpPtrIdx++;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
miMPPointers[pDev->id].pCursor = pCursor;
|
||||||
|
miMPPointers[pDev->id].pScreen = pScreen;
|
||||||
|
miPointerUpdateSprite(pDev);
|
||||||
|
#else
|
||||||
miPointer->pCursor = pCursor;
|
miPointer->pCursor = pCursor;
|
||||||
miPointer->pScreen = pScreen;
|
miPointer->pScreen = pScreen;
|
||||||
miPointerUpdateSprite(inputInfo.pointer);
|
miPointerUpdateSprite(inputInfo.pointer);
|
||||||
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,20 +289,22 @@ miPointerConstrainCursor (pDev, pScreen, pBox)
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
miPointerPointerNonInterestBox (pScreen, pBox)
|
miPointerPointerNonInterestBox (pDev, pScreen, pBox)
|
||||||
ScreenPtr pScreen;
|
DeviceIntPtr pDev;
|
||||||
BoxPtr pBox;
|
ScreenPtr pScreen;
|
||||||
|
BoxPtr pBox;
|
||||||
{
|
{
|
||||||
/* until DIX uses this, this will remain a stub */
|
/* until DIX uses this, this will remain a stub */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
miPointerCursorLimits(pScreen, pCursor, pHotBox, pTopLeftBox)
|
miPointerCursorLimits(pDev, pScreen, pCursor, pHotBox, pTopLeftBox)
|
||||||
ScreenPtr pScreen;
|
DeviceIntPtr pDev;
|
||||||
CursorPtr pCursor;
|
ScreenPtr pScreen;
|
||||||
BoxPtr pHotBox;
|
CursorPtr pCursor;
|
||||||
BoxPtr pTopLeftBox;
|
BoxPtr pHotBox;
|
||||||
|
BoxPtr pTopLeftBox;
|
||||||
{
|
{
|
||||||
*pTopLeftBox = *pHotBox;
|
*pTopLeftBox = *pHotBox;
|
||||||
}
|
}
|
||||||
|
@ -322,33 +312,40 @@ miPointerCursorLimits(pScreen, pCursor, pHotBox, pTopLeftBox)
|
||||||
static Bool GenerateEvent;
|
static Bool GenerateEvent;
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
miPointerSetCursorPosition(pScreen, x, y, generateEvent)
|
miPointerSetCursorPosition(pDev, pScreen, x, y, generateEvent)
|
||||||
ScreenPtr pScreen;
|
DeviceIntPtr pDev;
|
||||||
int x, y;
|
ScreenPtr pScreen;
|
||||||
Bool generateEvent;
|
int x, y;
|
||||||
|
Bool generateEvent;
|
||||||
{
|
{
|
||||||
SetupScreen (pScreen);
|
SetupScreen (pScreen);
|
||||||
|
|
||||||
GenerateEvent = generateEvent;
|
GenerateEvent = generateEvent;
|
||||||
/* device dependent - must pend signal and call miPointerWarpCursor */
|
/* device dependent - must pend signal and call miPointerWarpCursor */
|
||||||
(*pScreenPriv->screenFuncs->WarpCursor) (pScreen, x, y);
|
(*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
|
||||||
if (!generateEvent)
|
if (!generateEvent)
|
||||||
miPointerUpdateSprite(inputInfo.pointer);
|
miPointerUpdateSprite(pDev);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Once signals are ignored, the WarpCursor function can call this */
|
/* Once signals are ignored, the WarpCursor function can call this */
|
||||||
|
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
miPointerWarpCursor (pScreen, x, y)
|
miPointerWarpCursor (pDev, pScreen, x, y)
|
||||||
ScreenPtr pScreen;
|
DeviceIntPtr pDev;
|
||||||
int x, y;
|
ScreenPtr pScreen;
|
||||||
|
int x, y;
|
||||||
{
|
{
|
||||||
DeviceIntPtr pDev = inputInfo.pointer;
|
miPointerPtr pPointer = miPointer;
|
||||||
|
|
||||||
SetupScreen (pScreen);
|
SetupScreen (pScreen);
|
||||||
|
|
||||||
if (miPointer->pScreen != pScreen)
|
#ifdef MPX
|
||||||
|
if (IsMPDev(pDev))
|
||||||
|
pPointer = &miMPPointers[pDev->id];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
if (pPointer->pScreen != pScreen)
|
||||||
(*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, TRUE);
|
(*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, TRUE);
|
||||||
|
|
||||||
if (GenerateEvent)
|
if (GenerateEvent)
|
||||||
|
@ -359,16 +356,16 @@ miPointerWarpCursor (pScreen, x, y)
|
||||||
{
|
{
|
||||||
/* everything from miPointerMove except the event and history */
|
/* everything from miPointerMove except the event and history */
|
||||||
|
|
||||||
if (!pScreenPriv->waitForUpdate && pScreen == miPointer->pSpriteScreen)
|
if (!pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen)
|
||||||
{
|
{
|
||||||
miPointer->devx = x;
|
pPointer->devx = x;
|
||||||
miPointer->devy = y;
|
pPointer->devy = y;
|
||||||
if(!miPointer->pCursor->bits->emptyMask)
|
if(!pPointer->pCursor->bits->emptyMask)
|
||||||
(*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
|
(*pScreenPriv->spriteFuncs->MoveCursor) (pDev, pScreen, x, y);
|
||||||
}
|
}
|
||||||
miPointer->x = x;
|
pPointer->x = x;
|
||||||
miPointer->y = y;
|
pPointer->y = y;
|
||||||
miPointer->pScreen = pScreen;
|
pPointer->pScreen = pScreen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +392,7 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
|
||||||
miPointerScreenPtr pScreenPriv;
|
miPointerScreenPtr pScreenPriv;
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
int x, y, devx, devy;
|
int x, y, devx, devy;
|
||||||
miPointerPtr pPointer;
|
miPointerPtr pPointer = miPointer;
|
||||||
|
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
if (!pDev ||
|
if (!pDev ||
|
||||||
|
@ -408,8 +405,6 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
if (IsMPDev(pDev))
|
if (IsMPDev(pDev))
|
||||||
pPointer = &miMPPointers[pDev->id];
|
pPointer = &miMPPointers[pDev->id];
|
||||||
else
|
|
||||||
pPointer = miPointer;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pScreen = pPointer->pScreen;
|
pScreen = pPointer->pScreen;
|
||||||
|
@ -495,22 +490,18 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y)
|
||||||
{
|
{
|
||||||
miPointerScreenPtr pScreenPriv;
|
miPointerScreenPtr pScreenPriv;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
|
miPointerPtr pPointer = miPointer;
|
||||||
|
|
||||||
pScreen = screenInfo.screens[screen_no];
|
pScreen = screenInfo.screens[screen_no];
|
||||||
pScreenPriv = GetScreenPrivate (pScreen);
|
pScreenPriv = GetScreenPrivate (pScreen);
|
||||||
(*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, FALSE);
|
(*pScreenPriv->screenFuncs->NewEventScreen) (pScreen, FALSE);
|
||||||
NewCurrentScreen (pScreen, x, y);
|
NewCurrentScreen (pDev, pScreen, x, y);
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
if (IsMPDev(pDev))
|
if (IsMPDev(pDev))
|
||||||
{
|
pPointer = &miMPPointers[pDev->id];
|
||||||
miMPPointers[pDev->id].limits.x2 = pScreen->width;
|
|
||||||
miMPPointers[pDev->id].limits.y2 = pScreen->height;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
{
|
pPointer->limits.x2 = pScreen->width;
|
||||||
miPointer->limits.x2 = pScreen->width;
|
pPointer->limits.y2 = pScreen->height;
|
||||||
miPointer->limits.y2 = pScreen->height;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT ScreenPtr
|
_X_EXPORT ScreenPtr
|
||||||
|
@ -522,11 +513,12 @@ miPointerCurrentScreen ()
|
||||||
_X_EXPORT ScreenPtr
|
_X_EXPORT ScreenPtr
|
||||||
miPointerGetScreen(DeviceIntPtr pDev)
|
miPointerGetScreen(DeviceIntPtr pDev)
|
||||||
{
|
{
|
||||||
|
miPointerPtr pPointer;
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
if (IsMPDev(pDev))
|
if (IsMPDev(pDev))
|
||||||
return miMPPointers[pDev->id].pScreen;
|
pPointer = &miMPPointers[pDev->id];
|
||||||
#endif
|
#endif
|
||||||
return miPointer->pScreen;
|
return pPointer->pScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move the pointer to x, y on the current screen, update the sprite, and
|
/* Move the pointer to x, y on the current screen, update the sprite, and
|
||||||
|
@ -545,13 +537,11 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time)
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
ScreenPtr newScreen;
|
ScreenPtr newScreen;
|
||||||
|
|
||||||
miPointerPtr pPointer;
|
miPointerPtr pPointer = miPointer;
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
if (IsMPDev(pDev))
|
if (IsMPDev(pDev))
|
||||||
pPointer = &(miMPPointers[pDev->id]);
|
pPointer = &(miMPPointers[pDev->id]);
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
pPointer = miPointer;
|
|
||||||
|
|
||||||
pScreen = pPointer->pScreen;
|
pScreen = pPointer->pScreen;
|
||||||
if (!pScreen)
|
if (!pScreen)
|
||||||
|
@ -609,24 +599,19 @@ miPointerPosition (int *x, int *y)
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
|
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
|
||||||
{
|
{
|
||||||
|
miPointerPtr pPointer = miPointer;
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
if (IsMPDev(pDev))
|
if (IsMPDev(pDev))
|
||||||
{
|
pPointer = &miMPPointers[pDev->id];
|
||||||
*x = miMPPointers[pDev->id].x;
|
|
||||||
*y = miMPPointers[pDev->id].y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
*x = pPointer->x;
|
||||||
*x = miPointer->x;
|
*y = pPointer->y;
|
||||||
*y = miPointer->y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
miPointerMove (ScreenPtr pScreen, int x, int y, unsigned long time)
|
miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, unsigned long time)
|
||||||
{
|
{
|
||||||
miPointerMoved(inputInfo.pointer, pScreen, x, y, time);
|
miPointerMoved(pDev, pScreen, x, y, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move the pointer on the current screen, and update the sprite. */
|
/* Move the pointer on the current screen, and update the sprite. */
|
||||||
|
@ -634,15 +619,13 @@ void
|
||||||
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
|
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
|
||||||
unsigned long time)
|
unsigned long time)
|
||||||
{
|
{
|
||||||
miPointerPtr pPointer;
|
miPointerPtr pPointer = miPointer;
|
||||||
SetupScreen(pScreen);
|
SetupScreen(pScreen);
|
||||||
|
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
if (IsMPDev(pDev))
|
if (IsMPDev(pDev))
|
||||||
pPointer = &miMPPointers[pDev->id];
|
pPointer = &miMPPointers[pDev->id];
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
pPointer = miPointer;
|
|
||||||
|
|
||||||
if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer
|
if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer
|
||||||
#ifdef MPX
|
#ifdef MPX
|
||||||
|
|
|
@ -72,6 +72,7 @@ typedef struct _miPointerScreenFuncRec {
|
||||||
int /* entering */
|
int /* entering */
|
||||||
);
|
);
|
||||||
void (*WarpCursor)(
|
void (*WarpCursor)(
|
||||||
|
DeviceIntPtr /*pDev*/,
|
||||||
ScreenPtr /* pScr */,
|
ScreenPtr /* pScr */,
|
||||||
int /* x */,
|
int /* x */,
|
||||||
int /* y */
|
int /* y */
|
||||||
|
@ -99,6 +100,7 @@ extern Bool miPointerInitialize(
|
||||||
);
|
);
|
||||||
|
|
||||||
extern void miPointerWarpCursor(
|
extern void miPointerWarpCursor(
|
||||||
|
DeviceIntPtr /*pDev*/,
|
||||||
ScreenPtr /*pScreen*/,
|
ScreenPtr /*pScreen*/,
|
||||||
int /*x*/,
|
int /*x*/,
|
||||||
int /*y*/
|
int /*y*/
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "picturestr.h"
|
#include "picturestr.h"
|
||||||
|
#include "inputstr.h"
|
||||||
|
|
||||||
typedef struct _AnimCurElt {
|
typedef struct _AnimCurElt {
|
||||||
CursorPtr pCursor; /* cursor to show */
|
CursorPtr pCursor; /* cursor to show */
|
||||||
|
@ -100,11 +101,13 @@ int AnimCurGeneration;
|
||||||
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
AnimCurDisplayCursor (ScreenPtr pScreen,
|
AnimCurDisplayCursor (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCursor);
|
CursorPtr pCursor);
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
AnimCurSetCursorPosition (ScreenPtr pScreen,
|
AnimCurSetCursorPosition (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
Bool generateEvent);
|
Bool generateEvent);
|
||||||
|
@ -134,7 +137,8 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AnimCurCursorLimits (ScreenPtr pScreen,
|
AnimCurCursorLimits (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCursor,
|
CursorPtr pCursor,
|
||||||
BoxPtr pHotBox,
|
BoxPtr pHotBox,
|
||||||
BoxPtr pTopLeftBox)
|
BoxPtr pTopLeftBox)
|
||||||
|
@ -146,11 +150,13 @@ AnimCurCursorLimits (ScreenPtr pScreen,
|
||||||
{
|
{
|
||||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||||
|
|
||||||
(*pScreen->CursorLimits) (pScreen, ac->elts[0].pCursor, pHotBox, pTopLeftBox);
|
(*pScreen->CursorLimits) (pDev, pScreen, ac->elts[0].pCursor,
|
||||||
|
pHotBox, pTopLeftBox);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(*pScreen->CursorLimits) (pScreen, pCursor, pHotBox, pTopLeftBox);
|
(*pScreen->CursorLimits) (inputInfo.pointer, pScreen, pCursor,
|
||||||
|
pHotBox, pTopLeftBox);
|
||||||
}
|
}
|
||||||
Wrap (as, pScreen, CursorLimits, AnimCurCursorLimits);
|
Wrap (as, pScreen, CursorLimits, AnimCurCursorLimits);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +193,9 @@ AnimCurScreenBlockHandler (int screenNum,
|
||||||
*/
|
*/
|
||||||
DisplayCursor = pScreen->DisplayCursor;
|
DisplayCursor = pScreen->DisplayCursor;
|
||||||
pScreen->DisplayCursor = as->DisplayCursor;
|
pScreen->DisplayCursor = as->DisplayCursor;
|
||||||
(void) (*pScreen->DisplayCursor) (pScreen, ac->elts[elt].pCursor);
|
(void) (*pScreen->DisplayCursor) (inputInfo.pointer,
|
||||||
|
pScreen,
|
||||||
|
ac->elts[elt].pCursor);
|
||||||
as->DisplayCursor = pScreen->DisplayCursor;
|
as->DisplayCursor = pScreen->DisplayCursor;
|
||||||
pScreen->DisplayCursor = DisplayCursor;
|
pScreen->DisplayCursor = DisplayCursor;
|
||||||
|
|
||||||
|
@ -202,7 +210,8 @@ AnimCurScreenBlockHandler (int screenNum,
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
AnimCurDisplayCursor (ScreenPtr pScreen,
|
AnimCurDisplayCursor (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCursor)
|
CursorPtr pCursor)
|
||||||
{
|
{
|
||||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||||
|
@ -215,7 +224,8 @@ AnimCurDisplayCursor (ScreenPtr pScreen,
|
||||||
{
|
{
|
||||||
AnimCurPtr ac = GetAnimCur(pCursor);
|
AnimCurPtr ac = GetAnimCur(pCursor);
|
||||||
|
|
||||||
ret = (*pScreen->DisplayCursor) (pScreen, ac->elts[0].pCursor);
|
ret = (*pScreen->DisplayCursor)
|
||||||
|
(pDev, pScreen, ac->elts[0].pCursor);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
animCurState.elt = 0;
|
animCurState.elt = 0;
|
||||||
|
@ -231,14 +241,15 @@ AnimCurDisplayCursor (ScreenPtr pScreen,
|
||||||
{
|
{
|
||||||
animCurState.pCursor = 0;
|
animCurState.pCursor = 0;
|
||||||
animCurState.pScreen = 0;
|
animCurState.pScreen = 0;
|
||||||
ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
|
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
|
||||||
}
|
}
|
||||||
Wrap (as, pScreen, DisplayCursor, AnimCurDisplayCursor);
|
Wrap (as, pScreen, DisplayCursor, AnimCurDisplayCursor);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
AnimCurSetCursorPosition (ScreenPtr pScreen,
|
AnimCurSetCursorPosition (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
Bool generateEvent)
|
Bool generateEvent)
|
||||||
|
@ -249,13 +260,14 @@ AnimCurSetCursorPosition (ScreenPtr pScreen,
|
||||||
Unwrap (as, pScreen, SetCursorPosition);
|
Unwrap (as, pScreen, SetCursorPosition);
|
||||||
if (animCurState.pCursor)
|
if (animCurState.pCursor)
|
||||||
animCurState.pScreen = pScreen;
|
animCurState.pScreen = pScreen;
|
||||||
ret = (*pScreen->SetCursorPosition) (pScreen, x, y, generateEvent);
|
ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
|
||||||
Wrap (as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
|
Wrap (as, pScreen, SetCursorPosition, AnimCurSetCursorPosition);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
AnimCurRealizeCursor (ScreenPtr pScreen,
|
AnimCurRealizeCursor (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCursor)
|
CursorPtr pCursor)
|
||||||
{
|
{
|
||||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||||
|
@ -265,13 +277,14 @@ AnimCurRealizeCursor (ScreenPtr pScreen,
|
||||||
if (IsAnimCur(pCursor))
|
if (IsAnimCur(pCursor))
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
else
|
else
|
||||||
ret = (*pScreen->RealizeCursor) (pScreen, pCursor);
|
ret = (*pScreen->RealizeCursor) (pDev, pScreen, pCursor);
|
||||||
Wrap (as, pScreen, RealizeCursor, AnimCurRealizeCursor);
|
Wrap (as, pScreen, RealizeCursor, AnimCurRealizeCursor);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
AnimCurUnrealizeCursor (ScreenPtr pScreen,
|
AnimCurUnrealizeCursor (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCursor)
|
CursorPtr pCursor)
|
||||||
{
|
{
|
||||||
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
|
||||||
|
@ -289,13 +302,14 @@ AnimCurUnrealizeCursor (ScreenPtr pScreen,
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret = (*pScreen->UnrealizeCursor) (pScreen, pCursor);
|
ret = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
|
||||||
Wrap (as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
|
Wrap (as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
AnimCurRecolorCursor (ScreenPtr pScreen,
|
AnimCurRecolorCursor (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCursor,
|
CursorPtr pCursor,
|
||||||
Bool displayed)
|
Bool displayed)
|
||||||
{
|
{
|
||||||
|
@ -308,12 +322,12 @@ AnimCurRecolorCursor (ScreenPtr pScreen,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < ac->nelt; i++)
|
for (i = 0; i < ac->nelt; i++)
|
||||||
(*pScreen->RecolorCursor) (pScreen, ac->elts[i].pCursor,
|
(*pScreen->RecolorCursor) (pDev, pScreen, ac->elts[i].pCursor,
|
||||||
displayed &&
|
displayed &&
|
||||||
animCurState.elt == i);
|
animCurState.elt == i);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
(*pScreen->RecolorCursor) (pScreen, pCursor, displayed);
|
(*pScreen->RecolorCursor) (pDev, pScreen, pCursor, displayed);
|
||||||
Wrap (as, pScreen, RecolorCursor, AnimCurRecolorCursor);
|
Wrap (as, pScreen, RecolorCursor, AnimCurRecolorCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,8 @@ typedef struct _CursorScreen {
|
||||||
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
CursorDisplayCursor (ScreenPtr pScreen,
|
CursorDisplayCursor (DeviceIntPtr pDev,
|
||||||
|
ScreenPtr pScreen,
|
||||||
CursorPtr pCursor)
|
CursorPtr pCursor)
|
||||||
{
|
{
|
||||||
CursorScreenPtr cs = GetCursorScreen(pScreen);
|
CursorScreenPtr cs = GetCursorScreen(pScreen);
|
||||||
|
@ -131,9 +132,9 @@ CursorDisplayCursor (ScreenPtr pScreen,
|
||||||
Unwrap (cs, pScreen, DisplayCursor);
|
Unwrap (cs, pScreen, DisplayCursor);
|
||||||
|
|
||||||
if (cs->pCursorHideCounts != NULL) {
|
if (cs->pCursorHideCounts != NULL) {
|
||||||
ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor);
|
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pInvisibleCursor);
|
||||||
} else {
|
} else {
|
||||||
ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
|
ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pCursor != CursorCurrent)
|
if (pCursor != CursorCurrent)
|
||||||
|
@ -866,7 +867,7 @@ ProcXFixesHideCursor (ClientPtr client)
|
||||||
ret = createCursorHideCount(client, pWin->drawable.pScreen);
|
ret = createCursorHideCount(client, pWin->drawable.pScreen);
|
||||||
|
|
||||||
if (ret == Success) {
|
if (ret == Success) {
|
||||||
(void) CursorDisplayCursor(pWin->drawable.pScreen, CursorCurrent);
|
(void) CursorDisplayCursor(inputInfo.pointer, pWin->drawable.pScreen, CursorCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -953,7 +954,7 @@ CursorFreeHideCount (pointer data, XID id)
|
||||||
ScreenPtr pScreen = pChc->pScreen;
|
ScreenPtr pScreen = pChc->pScreen;
|
||||||
|
|
||||||
deleteCursorHideCount(pChc, pChc->pScreen);
|
deleteCursorHideCount(pChc, pChc->pScreen);
|
||||||
(void) CursorDisplayCursor(pScreen, CursorCurrent);
|
(void) CursorDisplayCursor(inputInfo.pointer, pScreen, CursorCurrent);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ ScreenPtr pScreen, oldScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pScreen != oldScreen)
|
if (pScreen != oldScreen)
|
||||||
NewCurrentScreen(pScreen, oldX, oldY);
|
NewCurrentScreen(inputInfo.pointer, pScreen, oldX, oldY);
|
||||||
if (pScreen->SetCursorPosition)
|
if (pScreen->SetCursorPosition)
|
||||||
(*pScreen->SetCursorPosition)(pScreen, oldX, oldY, TRUE);
|
(*pScreen->SetCursorPosition)(inputInfo.pointer, pScreen, oldX, oldY, TRUE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue