summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/dix/events.c')
-rw-r--r--xc/programs/Xserver/dix/events.c1512
1 files changed, 637 insertions, 875 deletions
diff --git a/xc/programs/Xserver/dix/events.c b/xc/programs/Xserver/dix/events.c
index 868d30df9..44f5bb255 100644
--- a/xc/programs/Xserver/dix/events.c
+++ b/xc/programs/Xserver/dix/events.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.23 1999/11/19 13:53:38 hohndel Exp $ */
+/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.29 2000/02/21 01:16:28 mvojkovi Exp $ */
/************************************************************
Copyright 1987, 1998 The Open Group
@@ -144,6 +144,9 @@ extern void (* EventSwapVector[128]) ();
#define WID(w) ((w) ? ((w)->drawable.id) : 0)
+#define XE_KBPTR (xE->u.keyButtonPointer)
+
+
#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
CallbackListPtr EventCallback;
@@ -186,13 +189,20 @@ static struct {
CursorPtr current;
BoxRec hotLimits; /* logical constraints of hot spot */
Bool confined; /* confined to screen */
-#ifdef SHAPE
+#if defined(SHAPE) || defined(PANORAMIX)
RegionPtr hotShape; /* additional logical shape constraint */
#endif
BoxRec physLimits; /* physical constraints of hot spot */
WindowPtr win; /* window of logical position */
HotSpot hot; /* logical pointer position */
HotSpot hotPhys; /* physical pointer position */
+#ifdef PANORAMIX
+ ScreenPtr screen; /* all others are in Screen 0 coordinates */
+ RegionRec Reg1; /* Region 1 for confining motion */
+ RegionRec Reg2; /* Region 2 for confining virtual motion */
+ WindowPtr windows[MAXSCREENS];
+ WindowPtr confineWin; /* confine window */
+#endif
} sprite; /* info about the cursor sprite */
static void DoEnterLeaveEvents(
@@ -275,6 +285,328 @@ static CARD8 criticalEvents[32] =
0x3c /* key and button events */
};
+#ifdef PANORAMIX
+
+static void ConfineToShape(RegionPtr shape, int *px, int *py);
+static void SyntheticMotion(int x, int y);
+static void PostNewCursor(void);
+
+static Bool
+PanoramiXSetCursorPosition(
+ int x,
+ int y,
+ Bool generateEvent
+){
+ ScreenPtr pScreen;
+ BoxRec box;
+ int i;
+
+ /* x,y are in Screen 0 coordinates. We need to decide what Screen
+ to send the message too and what the coordinates relative to
+ that screen are. */
+
+ pScreen = sprite.screen;
+ x += panoramiXdataPtr[0].x;
+ y += panoramiXdataPtr[0].y;
+
+ if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
+ x, y, &box))
+ {
+ FOR_NSCREENS(i)
+ {
+ if(i == pScreen->myNum)
+ continue;
+ if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box))
+ {
+ pScreen = screenInfo.screens[i];
+ break;
+ }
+ }
+ }
+
+ sprite.screen = pScreen;
+ sprite.hotPhys.x = x - panoramiXdataPtr[0].x;
+ sprite.hotPhys.y = y - panoramiXdataPtr[0].y;
+ x -= panoramiXdataPtr[pScreen->myNum].x;
+ y -= panoramiXdataPtr[pScreen->myNum].y;
+
+ return (*pScreen->SetCursorPosition)(pScreen, x, y, generateEvent);
+}
+
+
+static void
+PanoramiXConstrainCursor(void)
+{
+ ScreenPtr pScreen = sprite.screen;
+ BoxRec newBox = sprite.physLimits;
+
+ /* Translate the constraining box to the screen
+ the sprite is actually on */
+ newBox.x1 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x;
+ newBox.x2 += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x;
+ newBox.y1 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
+ newBox.y2 += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y;
+
+ (* pScreen->ConstrainCursor)(pScreen, &newBox);
+}
+
+static void
+PanoramiXCheckPhysLimits(
+ CursorPtr cursor,
+ Bool generateEvents
+){
+ HotSpot new;
+
+ if (!cursor)
+ return;
+
+ new = sprite.hotPhys;
+
+ /* I don't care what the DDX has to say about it */
+ sprite.physLimits = sprite.hotLimits;
+
+ /* constrain the pointer to those limits */
+ if (new.x < sprite.physLimits.x1)
+ new.x = sprite.physLimits.x1;
+ else
+ if (new.x >= sprite.physLimits.x2)
+ new.x = sprite.physLimits.x2 - 1;
+ if (new.y < sprite.physLimits.y1)
+ new.y = sprite.physLimits.y1;
+ else
+ if (new.y >= sprite.physLimits.y2)
+ new.y = sprite.physLimits.y2 - 1;
+
+ if (sprite.hotShape) /* more work if the shape is a mess */
+ ConfineToShape(sprite.hotShape, &new.x, &new.y);
+
+ if((new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y))
+ {
+ PanoramiXSetCursorPosition (new.x, new.y, generateEvents);
+ if (!generateEvents)
+ SyntheticMotion(new.x, new.y);
+ }
+
+ /* Tell DDX what the limits are */
+ PanoramiXConstrainCursor();
+}
+
+
+static Bool
+PanoramiXSetWindowPntrs(WindowPtr pWin)
+{
+ if(pWin == WindowTable[0]) {
+ memcpy(sprite.windows, WindowTable,
+ PanoramiXNumScreens*sizeof(WindowPtr));
+ } else {
+ PanoramiXRes *win;
+ int i;
+
+ win = (PanoramiXRes*)LookupIDByType(pWin->drawable.id, XRT_WINDOW);
+
+ if(!win)
+ return FALSE;
+
+ for(i = 0; i < PanoramiXNumScreens; i++) {
+ sprite.windows[i] = LookupIDByType(win->info[i].id, RT_WINDOW);
+ if(!sprite.windows[i]) /* window is being unmapped */
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+static void
+PanoramiXCheckVirtualMotion(
+ QdEventPtr qe,
+ WindowPtr pWin
+){
+
+ if (qe)
+ {
+ sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */
+ sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
+ sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
+ pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
+ NullWindow;
+ }
+ if (pWin)
+ {
+ int x, y, off_x, off_y, i;
+ BoxRec lims;
+
+ if(!PanoramiXSetWindowPntrs(pWin))
+ return;
+
+ i = PanoramiXNumScreens - 1;
+
+ REGION_COPY(sprite.screen, &sprite.Reg2,
+ &sprite.windows[i]->borderSize);
+ off_x = panoramiXdataPtr[i].x;
+ off_y = panoramiXdataPtr[i].y;
+
+ while(i--) {
+ x = off_x - panoramiXdataPtr[i].x;
+ y = off_y - panoramiXdataPtr[i].y;
+
+ if(x || y)
+ REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y);
+
+ REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2,
+ &sprite.windows[i]->borderSize);
+
+ off_x = panoramiXdataPtr[i].x;
+ off_y = panoramiXdataPtr[i].y;
+ }
+
+ lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2);
+
+ if (sprite.hot.x < lims.x1)
+ sprite.hot.x = lims.x1;
+ else if (sprite.hot.x >= lims.x2)
+ sprite.hot.x = lims.x2 - 1;
+ if (sprite.hot.y < lims.y1)
+ sprite.hot.y = lims.y1;
+ else if (sprite.hot.y >= lims.y2)
+ sprite.hot.y = lims.y2 - 1;
+
+ if (REGION_NUM_RECTS(&sprite.Reg2) > 1)
+ ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y);
+
+ if (qe)
+ {
+ qe->pScreen = sprite.hot.pScreen;
+ qe->event->u.keyButtonPointer.rootX = sprite.hot.x;
+ qe->event->u.keyButtonPointer.rootY = sprite.hot.y;
+ }
+ }
+}
+
+
+static Bool
+PanoramiXCheckMotion(xEvent *xE)
+{
+ WindowPtr prevSpriteWin = sprite.win;
+
+ if (xE && !syncEvents.playingEvents)
+ {
+ /* Motion events entering DIX get translated to Screen 0
+ coordinates. Replayed events have already been
+ translated since they've entered DIX before */
+ XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x -
+ panoramiXdataPtr[0].x;
+ XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y -
+ panoramiXdataPtr[0].y;
+
+ sprite.hot.x = XE_KBPTR.rootX;
+ sprite.hot.y = XE_KBPTR.rootY;
+ if (sprite.hot.x < sprite.physLimits.x1)
+ sprite.hot.x = sprite.physLimits.x1;
+ else if (sprite.hot.x >= sprite.physLimits.x2)
+ sprite.hot.x = sprite.physLimits.x2 - 1;
+ if (sprite.hot.y < sprite.physLimits.y1)
+ sprite.hot.y = sprite.physLimits.y1;
+ else if (sprite.hot.y >= sprite.physLimits.y2)
+ sprite.hot.y = sprite.physLimits.y2 - 1;
+
+ if (sprite.hotShape)
+ ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
+
+ sprite.hotPhys = sprite.hot;
+ if ((sprite.hotPhys.x != XE_KBPTR.rootX) ||
+ (sprite.hotPhys.y != XE_KBPTR.rootY))
+ {
+ PanoramiXSetCursorPosition(
+ sprite.hotPhys.x, sprite.hotPhys.y, FALSE);
+ }
+ XE_KBPTR.rootX = sprite.hot.x;
+ XE_KBPTR.rootY = sprite.hot.y;
+ }
+
+ sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
+
+ if (sprite.win != prevSpriteWin)
+ {
+ if (prevSpriteWin != NullWindow) {
+ if (!xE)
+ UpdateCurrentTimeIf();
+ DoEnterLeaveEvents(prevSpriteWin, sprite.win, NotifyNormal);
+ }
+ PostNewCursor();
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+static void
+PanoramiXConfineCursorToWindow(WindowPtr pWin, Bool generateEvents)
+{
+
+ if (syncEvents.playingEvents)
+ {
+ PanoramiXCheckVirtualMotion((QdEventPtr)NULL, pWin);
+ SyntheticMotion(sprite.hot.x, sprite.hot.y);
+ }
+ else
+ {
+ int x, y, off_x, off_y, i;
+
+ if(!PanoramiXSetWindowPntrs(pWin))
+ return;
+
+ i = PanoramiXNumScreens - 1;
+
+ REGION_COPY(sprite.screen, &sprite.Reg1,
+ &sprite.windows[i]->borderSize);
+ off_x = panoramiXdataPtr[i].x;
+ off_y = panoramiXdataPtr[i].y;
+
+ while(i--) {
+ x = off_x - panoramiXdataPtr[i].x;
+ y = off_y - panoramiXdataPtr[i].y;
+
+ if(x || y)
+ REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y);
+
+ REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1,
+ &sprite.windows[i]->borderSize);
+
+ off_x = panoramiXdataPtr[i].x;
+ off_y = panoramiXdataPtr[i].y;
+ }
+
+ sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1);
+
+ if(REGION_NUM_RECTS(&sprite.Reg1) > 1)
+ sprite.hotShape = &sprite.Reg1;
+ else
+ sprite.hotShape = NullRegion;
+
+ sprite.confined = FALSE;
+ sprite.confineWin = (pWin == WindowTable[0]) ? NullWindow : pWin;
+
+ PanoramiXCheckPhysLimits(sprite.current, generateEvents);
+ }
+}
+
+
+static void
+PanoramiXChangeToCursor(CursorPtr cursor)
+{
+ if (cursor != sprite.current)
+ {
+ if ((sprite.current->bits->xhot != cursor->bits->xhot) ||
+ (sprite.current->bits->yhot != cursor->bits->yhot))
+ PanoramiXCheckPhysLimits(cursor, FALSE);
+ (*sprite.screen->DisplayCursor)(sprite.screen, cursor);
+ sprite.current = cursor;
+ }
+}
+
+
+#endif /* PANORAMIX */
+
Mask
GetNextEventMask()
{
@@ -311,6 +643,15 @@ SyntheticMotion(x, y)
{
xEvent xE;
+#ifdef PANORAMIX
+ /* Translate back to the sprite screen since processInputProc
+ will translate from sprite screen to screen 0 upon reentry
+ to the DIX layer */
+ if(!noPanoramiXExtension) {
+ x += panoramiXdataPtr[0].x - panoramiXdataPtr[sprite.screen->myNum].x;
+ y += panoramiXdataPtr[0].y - panoramiXdataPtr[sprite.screen->myNum].y;
+ }
+#endif
xE.u.keyButtonPointer.rootX = x;
xE.u.keyButtonPointer.rootY = y;
if (syncEvents.playingEvents)
@@ -405,7 +746,7 @@ CheckPhysLimits(cursor, generateEvents, confineToScreen, pScreen)
new.y = sprite.physLimits.y2 - 1;
#ifdef SHAPE
if (sprite.hotShape)
- ConfineToShape(sprite.hotShape, &new.x, &new.y);
+ ConfineToShape(sprite.hotShape, &new.x, &new.y);
#endif
if ((pScreen != sprite.hotPhys.pScreen) ||
(new.x != sprite.hotPhys.x) || (new.y != sprite.hotPhys.y))
@@ -429,7 +770,12 @@ CheckVirtualMotion(qe, pWin)
register WindowPtr pWin;
#endif
{
-
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ PanoramiXCheckVirtualMotion(qe, pWin);
+ return;
+ }
+#endif
if (qe)
{
sprite.hot.pScreen = qe->pScreen;
@@ -478,6 +824,13 @@ ConfineCursorToWindow(pWin, generateEvents, confineToScreen)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ PanoramiXConfineCursorToWindow(pWin, generateEvents);
+ return;
+ }
+#endif
+
if (syncEvents.playingEvents)
{
CheckVirtualMotion((QdEventPtr)NULL, pWin);
@@ -509,11 +862,18 @@ ChangeToCursor(cursor)
CursorPtr cursor;
#endif
{
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ PanoramiXChangeToCursor(cursor);
+ return;
+ }
+#endif
+
if (cursor != sprite.current)
{
if ((sprite.current->bits->xhot != cursor->bits->xhot) ||
(sprite.current->bits->yhot != cursor->bits->yhot))
- CheckPhysLimits(cursor, FALSE, PointerConfinedToScreen(),
+ CheckPhysLimits(cursor, FALSE, sprite.confined,
(ScreenPtr)NULL);
(*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen,
cursor);
@@ -605,10 +965,10 @@ MonthChangedOrBadTime(xE)
* different sources in sorted order, then it's possible for time to go
* backwards when it should not. Here we ensure a decent time.
*/
- if ((currentTime.milliseconds - xE->u.keyButtonPointer.time) > TIMESLOP)
+ if ((currentTime.milliseconds - XE_KBPTR.time) > TIMESLOP)
currentTime.months++;
else
- xE->u.keyButtonPointer.time = currentTime.milliseconds;
+ XE_KBPTR.time = currentTime.milliseconds;
}
#define NoticeTime(xE) { \
@@ -653,7 +1013,7 @@ EnqueueEvent(xE, device, count)
* updated yet.
*/
if (xE->u.u.type == MotionNotify)
- xE->u.keyButtonPointer.root =
+ XE_KBPTR.root =
WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id;
eventinfo.events = xE;
eventinfo.count = count;
@@ -661,8 +1021,16 @@ EnqueueEvent(xE, device, count)
}
if (xE->u.u.type == MotionNotify)
{
- sprite.hotPhys.x = xE->u.keyButtonPointer.rootX;
- sprite.hotPhys.y = xE->u.keyButtonPointer.rootY;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ XE_KBPTR.rootX += panoramiXdataPtr[sprite.screen->myNum].x -
+ panoramiXdataPtr[0].x;
+ XE_KBPTR.rootY += panoramiXdataPtr[sprite.screen->myNum].y -
+ panoramiXdataPtr[0].y;
+ }
+#endif
+ sprite.hotPhys.x = XE_KBPTR.rootX;
+ sprite.hotPhys.y = XE_KBPTR.rootY;
/* do motion compression */
if (tail &&
(tail->event->u.u.type == MotionNotify) &&
@@ -670,7 +1038,7 @@ EnqueueEvent(xE, device, count)
{
tail->event->u.keyButtonPointer.rootX = sprite.hotPhys.x;
tail->event->u.keyButtonPointer.rootY = sprite.hotPhys.y;
- tail->event->u.keyButtonPointer.time = xE->u.keyButtonPointer.time;
+ tail->event->u.keyButtonPointer.time = XE_KBPTR.time;
tail->months = currentTime.months;
return;
}
@@ -713,6 +1081,19 @@ PlayReleasedEvents()
CheckVirtualMotion(qe, NullWindow);
syncEvents.time.months = qe->months;
syncEvents.time.milliseconds = qe->event->u.keyButtonPointer.time;
+#ifdef PANORAMIX
+ /* Translate back to the sprite screen since processInputProc
+ will translate from sprite screen to screen 0 upon reentry
+ to the DIX layer */
+ if(!noPanoramiXExtension) {
+ qe->event->u.keyButtonPointer.rootX +=
+ panoramiXdataPtr[0].x -
+ panoramiXdataPtr[sprite.screen->myNum].x;
+ qe->event->u.keyButtonPointer.rootY +=
+ panoramiXdataPtr[0].y -
+ panoramiXdataPtr[sprite.screen->myNum].y;
+ }
+#endif
(*qe->device->public.processInputProc)(qe->event, qe->device,
qe->evcount);
xfree(qe);
@@ -763,68 +1144,25 @@ ComputeFreezes()
syncEvents.playingEvents = TRUE;
if (replayDev)
{
-#ifdef PANORAMIX
- int j;
- WindowPtr tempw;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
xE = replayDev->sync.event;
count = replayDev->sync.evcount;
syncEvents.replayDev = (DeviceIntPtr)NULL;
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- for (j = PanoramiXNumScreens - 1; j>=0; j--)
- if (XE_PTR.rootX >= panoramiXdataPtr[j].x
- && XE_PTR.rootX < (panoramiXdataPtr[j].x + panoramiXdataPtr[j].width)
- && XE_PTR.rootY >= panoramiXdataPtr[j].y
- && XE_PTR.rootY < (panoramiXdataPtr[j].y +panoramiXdataPtr[j].height))
- break;
- XE_PTR.rootX -= panoramiXdataPtr[j].x;
- XE_PTR.rootY -= panoramiXdataPtr[j].y;
- XE_PTR.eventX -= panoramiXdataPtr[j].x;
- XE_PTR.eventY -= panoramiXdataPtr[j].y;
- w = XYToWindow(XE_PTR.rootX, XE_PTR.rootY);
- }else
-#endif
- w = XYToWindow(
- xE->u.keyButtonPointer.rootX, xE->u.keyButtonPointer.rootY);
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- for (i = 0; i < spriteTraceGood; i++) {
- tempw = spriteTrace[i];
- j = (tempw->drawable.pScreen)->myNum;
- PANORAMIXFIND_ID_BY_SCRNUM(pPanoramiXWin, tempw->drawable.id, j);
- j = ((syncEvents.replayWin)->drawable.pScreen)->myNum;
- if (pPanoramiXWin)
- tempw = (WindowPtr)
- LookupIDByType(pPanoramiXWin->info[0].id, RT_WINDOW);
-
- if (syncEvents.replayWin == tempw) {
- if (!CheckDeviceGrabs(replayDev, xE, i+1, count))
- if (replayDev->focus)
- DeliverFocusedEvent(replayDev, xE, w, count);
- else
- DeliverDeviceEvents(w, xE, NullGrab, NullWindow,
- replayDev, count);
- goto playmore;
- }
- } /* for */
- } else { /* if !noPanoramiXExtension */
-#endif
- for (i = 0; i < spriteTraceGood; i++)
- if (syncEvents.replayWin == spriteTrace[i])
- {
- if (!CheckDeviceGrabs(replayDev, xE, i+1, count))
- if (replayDev->focus)
- DeliverFocusedEvent(replayDev, xE, w, count);
- else
- DeliverDeviceEvents(w, xE, NullGrab, NullWindow,
+
+ w = XYToWindow( XE_KBPTR.rootX, XE_KBPTR.rootY);
+ for (i = 0; i < spriteTraceGood; i++)
+ {
+ if (syncEvents.replayWin == spriteTrace[i])
+ {
+ if (!CheckDeviceGrabs(replayDev, xE, i+1, count)) {
+ if (replayDev->focus)
+ DeliverFocusedEvent(replayDev, xE, w, count);
+ else
+ DeliverDeviceEvents(w, xE, NullGrab, NullWindow,
replayDev, count);
- goto playmore;
- }
-#ifdef PANORAMIX
- }
-#endif
+ }
+ goto playmore;
+ }
+ }
/* must not still be in the same stack */
if (replayDev->focus)
DeliverFocusedEvent(replayDev, xE, w, count);
@@ -904,14 +1242,6 @@ ActivatePointerGrab(mouse, grab, time, autoGrab)
{
if (grab->confineTo->drawable.pScreen != sprite.hotPhys.pScreen)
sprite.hotPhys.x = sprite.hotPhys.y = 0;
-#ifdef PANORAMIX
- if ((!noPanoramiXExtension) &&
- ( grab->confineTo->drawable.x + grab->confineTo->drawable.width >
- (grab->confineTo->drawable.pScreen)->width ||
- grab->confineTo->drawable.x < 0) )
- ConfineCursorToWindow(grab->confineTo, FALSE, FALSE);
- else
-#endif
ConfineCursorToWindow(grab->confineTo, FALSE, TRUE);
}
DoEnterLeaveEvents(oldWin, grab->window, NotifyGrab);
@@ -926,8 +1256,7 @@ ActivatePointerGrab(mouse, grab, time, autoGrab)
mouse->grab = &mouse->activeGrab;
mouse->fromPassiveGrab = autoGrab;
PostNewCursor();
- CheckGrabForSyncs(mouse,
- (Bool)grab->pointerMode, (Bool)grab->keyboardMode);
+ CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode);
}
void
@@ -982,8 +1311,7 @@ ActivateKeyboardGrab(keybd, grab, time, passive)
keybd->activeGrab = *grab;
keybd->grab = &keybd->activeGrab;
keybd->fromPassiveGrab = passive;
- CheckGrabForSyncs(keybd,
- (Bool)grab->keyboardMode, (Bool)grab->pointerMode);
+ CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode);
}
void
@@ -1382,6 +1710,24 @@ DeliverEventsToWindow(pWin, pEvents, count, filter, grab, mskidx)
Only works for core events.
*/
+#ifdef PANORAMIX
+static int
+PanoramiXTryClientEventsResult(
+ ClientPtr client,
+ GrabPtr grab,
+ Mask mask,
+ Mask filter
+){
+ if ((client) && (client != serverClient) && (!client->clientGone) &&
+ ((filter == CantBeFiltered) || (mask & filter)))
+ {
+ if (grab && !SameClient(grab, client)) return -1;
+ else return 1;
+ }
+ return 0;
+}
+#endif
+
int
MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient)
register WindowPtr pWin;
@@ -1392,10 +1738,16 @@ MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient)
{
register OtherClients *other;
+
if (pWin->eventMask & filter)
{
if (wClient(pWin) == dontClient)
return 0;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
+ return PanoramiXTryClientEventsResult(
+ wClient(pWin), NullGrab, pWin->eventMask, filter);
+#endif
return TryClientEvents(wClient(pWin), pEvents, count,
pWin->eventMask, filter, NullGrab);
}
@@ -1405,6 +1757,11 @@ MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient)
{
if (SameClient(other, dontClient))
return 0;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
+ return PanoramiXTryClientEventsResult(
+ rClient(other), NullGrab, other->mask, filter);
+#endif
return TryClientEvents(rClient(other), pEvents, count,
other->mask, filter, NullGrab);
}
@@ -1427,23 +1784,9 @@ FixUpEventFromWindow(xE, pWin, child, calcChild)
Bool calcChild;
#endif
{
-#ifdef PANORAMIX
- int j;
- int k = (pWin->drawable.pScreen)->myNum;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
-
if (calcChild)
{
WindowPtr w=spriteTrace[spriteTraceGood-1];
-#ifdef PANORAMIX
- if (!noPanoramiXExtension){
- j = (w->drawable.pScreen)->myNum;
- PANORAMIXFIND_ID_BY_SCRNUM(pPanoramiXWin, w->drawable.id, j);
- if (pPanoramiXWin)
- w = (WindowPtr)LookupIDByType(pPanoramiXWin->info[k].id, RT_WINDOW);
- }
-#endif
/* If the search ends up past the root should the child field be
set to none or should the value in the argument be passed
through. It probably doesn't matter since everyone calls
@@ -1468,48 +1811,34 @@ FixUpEventFromWindow(xE, pWin, child, calcChild)
w = w->parent;
}
}
- xE->u.keyButtonPointer.root = ROOT->drawable.id;
-#ifdef PANORAMIX
- if (!noPanoramiXExtension){
- pPanoramiXWin=PanoramiXWinRoot;
- PANORAMIXFIND_ID_BY_SCRNUM(pPanoramiXWin, pWin->drawable.id, k);
- if (pPanoramiXWin)
- pWin = (WindowPtr)LookupIDByType(pPanoramiXWin->info[0].id, RT_WINDOW);
- if (pWin) {
- xE->u.keyButtonPointer.event = pWin->drawable.id;
- xE->u.keyButtonPointer.eventX = xE->u.keyButtonPointer.rootX -
- pWin->drawable.x +
- panoramiXdataPtr[sprite.hot.pScreen->myNum].x;
- xE->u.keyButtonPointer.eventY = xE->u.keyButtonPointer.rootY -
- pWin->drawable.y +
- panoramiXdataPtr[sprite.hot.pScreen->myNum].y;
- }else if (pPanoramiXWin)
- xE->u.keyButtonPointer.event = pPanoramiXWin->info[0].id;
- xE->u.keyButtonPointer.sameScreen = xTrue;
- xE->u.keyButtonPointer.child = child;
- }
- else {
-#endif
- xE->u.keyButtonPointer.event = pWin->drawable.id;
- if (sprite.hot.pScreen == pWin->drawable.pScreen)
- {
- xE->u.keyButtonPointer.sameScreen = xTrue;
- xE->u.keyButtonPointer.child = child;
- xE->u.keyButtonPointer.eventX =
- xE->u.keyButtonPointer.rootX - pWin->drawable.x;
- xE->u.keyButtonPointer.eventY =
- xE->u.keyButtonPointer.rootY - pWin->drawable.y;
- }
- else
- {
- xE->u.keyButtonPointer.sameScreen = xFalse;
- xE->u.keyButtonPointer.child = None;
- xE->u.keyButtonPointer.eventX = 0;
- xE->u.keyButtonPointer.eventY = 0;
- }
+ XE_KBPTR.root = ROOT->drawable.id;
+ XE_KBPTR.event = pWin->drawable.id;
+ if (sprite.hot.pScreen == pWin->drawable.pScreen)
+ {
+ XE_KBPTR.sameScreen = xTrue;
+ XE_KBPTR.child = child;
+ XE_KBPTR.eventX =
+ XE_KBPTR.rootX - pWin->drawable.x;
+ XE_KBPTR.eventY =
+ XE_KBPTR.rootY - pWin->drawable.y;
#ifdef PANORAMIX
- }
+ if(!noPanoramiXExtension) {
+ XE_KBPTR.rootX += panoramiXdataPtr[0].x;
+ XE_KBPTR.rootY += panoramiXdataPtr[0].y;
+ if(pWin == WindowTable[0]) {
+ XE_KBPTR.eventX += panoramiXdataPtr[0].x;
+ XE_KBPTR.eventY += panoramiXdataPtr[0].y;
+ }
+ }
#endif
+ }
+ else
+ {
+ XE_KBPTR.sameScreen = xFalse;
+ XE_KBPTR.child = None;
+ XE_KBPTR.eventX = 0;
+ XE_KBPTR.eventY = 0;
+ }
}
int
@@ -1589,6 +1918,11 @@ DeliverEvents(pWin, xE, count, otherParent)
Mask filter;
int deliveries;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
+ return count;
+#endif
+
if (!count)
return 0;
filter = filters[xE->u.u.type];
@@ -1615,6 +1949,32 @@ DeliverEvents(pWin, xE, count, otherParent)
return deliveries;
}
+
+static Bool
+PointInBorderSize(WindowPtr pWin, int x, int y)
+{
+ BoxRec box;
+
+ if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box))
+ return TRUE;
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension && PanoramiXSetWindowPntrs(pWin)) {
+ int i;
+
+ for(i = 1; i < PanoramiXNumScreens; i++) {
+ if(POINT_IN_REGION(sprite.screen,
+ &sprite.windows[i]->borderSize,
+ x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x,
+ y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y,
+ &box))
+ return TRUE;
+ }
+ }
+#endif
+ return FALSE;
+}
+
static WindowPtr
#if NeedFunctionPrototypes
XYToWindow(int x, int y)
@@ -1624,9 +1984,6 @@ XYToWindow(x, y)
#endif
{
register WindowPtr pWin;
-#ifdef SHAPE
- BoxRec box;
-#endif
spriteTraceGood = 1; /* root window still there */
pWin = ROOT->firstChild;
@@ -1644,9 +2001,7 @@ XYToWindow(x, y)
* is made to see if the point is inside
* borderSize
*/
- && (!wBoundingShape(pWin) ||
- POINT_IN_REGION(pWin->drawable.pScreen,
- &pWin->borderSize, x, y, &box))
+ && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y))
#endif
)
{
@@ -1677,6 +2032,11 @@ CheckMotion(xE)
{
WindowPtr prevSpriteWin = sprite.win;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension)
+ return PanoramiXCheckMotion(xE);
+#endif
+
if (xE && !syncEvents.playingEvents)
{
if (sprite.hot.pScreen != sprite.hotPhys.pScreen)
@@ -1684,8 +2044,8 @@ CheckMotion(xE)
sprite.hot.pScreen = sprite.hotPhys.pScreen;
ROOT = WindowTable[sprite.hot.pScreen->myNum];
}
- sprite.hot.x = xE->u.keyButtonPointer.rootX;
- sprite.hot.y = xE->u.keyButtonPointer.rootY;
+ sprite.hot.x = XE_KBPTR.rootX;
+ sprite.hot.y = XE_KBPTR.rootY;
if (sprite.hot.x < sprite.physLimits.x1)
sprite.hot.x = sprite.physLimits.x1;
else if (sprite.hot.x >= sprite.physLimits.x2)
@@ -1699,13 +2059,15 @@ CheckMotion(xE)
ConfineToShape(sprite.hotShape, &sprite.hot.x, &sprite.hot.y);
#endif
sprite.hotPhys = sprite.hot;
- if ((sprite.hotPhys.x != xE->u.keyButtonPointer.rootX) ||
- (sprite.hotPhys.y != xE->u.keyButtonPointer.rootY))
+ if ((sprite.hotPhys.x != XE_KBPTR.rootX) ||
+ (sprite.hotPhys.y != XE_KBPTR.rootY))
+ {
(*sprite.hotPhys.pScreen->SetCursorPosition)(
sprite.hotPhys.pScreen,
sprite.hotPhys.x, sprite.hotPhys.y, FALSE);
- xE->u.keyButtonPointer.rootX = sprite.hot.x;
- xE->u.keyButtonPointer.rootY = sprite.hot.y;
+ }
+ XE_KBPTR.rootX = sprite.hot.x;
+ XE_KBPTR.rootY = sprite.hot.y;
}
sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
@@ -1758,6 +2120,21 @@ DefineInitialRootWindow(win)
(*pScreen->ConstrainCursor) (pScreen, &sprite.physLimits);
(*pScreen->SetCursorPosition) (pScreen, sprite.hot.x, sprite.hot.y, FALSE);
(*pScreen->DisplayCursor) (pScreen, sprite.current);
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ sprite.hotLimits.x1 = -panoramiXdataPtr[0].x;
+ sprite.hotLimits.y1 = -panoramiXdataPtr[0].y;
+ sprite.hotLimits.x2 = PanoramiXPixWidth - panoramiXdataPtr[0].x;
+ sprite.hotLimits.y2 = PanoramiXPixHeight - panoramiXdataPtr[0].y;
+ sprite.physLimits = sprite.hotLimits;
+ sprite.confineWin = NullWindow;
+ sprite.screen = pScreen;
+ /* gotta UNINIT these someplace */
+ REGION_INIT(pScreen, &sprite.Reg1, NullBox, 1);
+ REGION_INIT(pScreen, &sprite.Reg2, NullBox, 1);
+ }
+#endif
}
/*
@@ -1782,10 +2159,33 @@ NewCurrentScreen(newScreen, x, y)
{
sprite.hotPhys.x = x;
sprite.hotPhys.y = y;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ sprite.hotPhys.x += panoramiXdataPtr[newScreen->myNum].x -
+ panoramiXdataPtr[0].x;
+ sprite.hotPhys.y += panoramiXdataPtr[newScreen->myNum].y -
+ panoramiXdataPtr[0].y;
+ if (newScreen != sprite.screen) {
+ sprite.screen = newScreen;
+ /* Make sure we tell the DDX to update its copy of the screen */
+ if(sprite.confineWin)
+ PanoramiXConfineCursorToWindow(sprite.confineWin, TRUE);
+ else
+ PanoramiXConfineCursorToWindow(WindowTable[0], TRUE);
+ /* if the pointer wasn't confined, the DDX won't get
+ told of the pointer warp so we reposition it here */
+ if(!syncEvents.playingEvents)
+ (*sprite.screen->SetCursorPosition)(sprite.screen,
+ sprite.hotPhys.x + panoramiXdataPtr[0].x -
+ panoramiXdataPtr[sprite.screen->myNum].x,
+ sprite.hotPhys.y + panoramiXdataPtr[0].y -
+ panoramiXdataPtr[sprite.screen->myNum].y, FALSE);
+ }
+ } else
+#endif
if (newScreen != sprite.hotPhys.pScreen)
ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE);
}
-
int
ProcWarpPointer(client)
ClientPtr client;
@@ -1793,9 +2193,6 @@ ProcWarpPointer(client)
WindowPtr dest = NULL;
int x, y;
ScreenPtr newScreen;
-#ifdef PANORAMIX
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
REQUEST(xWarpPointerReq);
@@ -1808,13 +2205,16 @@ ProcWarpPointer(client)
}
x = sprite.hotPhys.x;
y = sprite.hotPhys.y;
+
if (stuff->srcWid != None)
{
int winX, winY;
- WindowPtr source = SecurityLookupWindow(stuff->srcWid, client,
- SecurityReadAccess);
- if (!source)
- return BadWindow;
+ XID winID = stuff->srcWid;
+ WindowPtr source;
+
+ source = SecurityLookupWindow(winID, client, SecurityReadAccess);
+ if (!source) return BadWindow;
+
winX = source->drawable.x;
winY = source->drawable.y;
if (source->drawable.pScreen != sprite.hotPhys.pScreen ||
@@ -1827,64 +2227,18 @@ ProcWarpPointer(client)
!PointInWindowIsVisible(source, x, y))
return Success;
}
- if (dest)
- {
+ if (dest) {
x = dest->drawable.x;
y = dest->drawable.y;
newScreen = dest->drawable.pScreen;
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->dstWid);
-#endif
} else
newScreen = sprite.hotPhys.pScreen;
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- x += panoramiXdataPtr[newScreen->myNum].x;
- y += panoramiXdataPtr[newScreen->myNum].y;
- }
-#endif
-
-
x += stuff->dstX;
y += stuff->dstY;
+
#ifdef PANORAMIX
- if ( !noPanoramiXExtension && pPanoramiXWin) {
- int i, softx, softy;
- WindowPtr sWin = NULL;
- ScreenPtr sftScreen = sprite.hotPhys.pScreen;
-
- for ( i = 0 ; i < PanoramiXNumScreens; i++) {
- sWin = SecurityLookupWindow(pPanoramiXWin->info[i].id, client,
- SecurityReadAccess);
- sftScreen = sWin->drawable.pScreen;
- softx = sftScreen->width + panoramiXdataPtr[i].x;
- softy = sftScreen->height + panoramiXdataPtr[i].y;
- /* Figure out which screen the cursor is on. The destination (x,y)
- values are coming from the client, so it believes we have a screen
- size of (sizeofScreen * NumberOfScreens )*/
- if (x < 0)
- x = 0;
- if (y < 0)
- y = 0;
- if ((x > softx) || (y > softy))
- continue;
- else
- break;
- }
- newScreen = sftScreen;
- if (x < 0)
- x = 0;
- else if (x >= newScreen->width + panoramiXdataPtr[newScreen->myNum].x )
- x = newScreen->width + panoramiXdataPtr[newScreen->myNum].x - 1;
- if (y < 0)
- y = 0;
- else if (y >= newScreen->height + panoramiXdataPtr[newScreen->myNum].y )
- y = newScreen->height + panoramiXdataPtr[newScreen->myNum].y - 1;
- x -= panoramiXdataPtr[newScreen->myNum].x;
- y -= panoramiXdataPtr[newScreen->myNum].y;
- } else
+ if(noPanoramiXExtension) /* Clip to the SLS not Screen 0 */
#endif
{
if (x < 0)
@@ -1896,6 +2250,7 @@ ProcWarpPointer(client)
else if (y >= newScreen->height)
y = newScreen->height - 1;
}
+
if (newScreen == sprite.hotPhys.pScreen)
{
if (x < sprite.physLimits.x1)
@@ -1906,10 +2261,15 @@ ProcWarpPointer(client)
y = sprite.physLimits.y1;
else if (y >= sprite.physLimits.y2)
y = sprite.physLimits.y2 - 1;
-#ifdef SHAPE
+#if defined(SHAPE) || defined(PANORAMIX)
if (sprite.hotShape)
ConfineToShape(sprite.hotShape, &x, &y);
#endif
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension)
+ PanoramiXSetCursorPosition(x, y, TRUE);
+ else
+#endif
(*newScreen->SetCursorPosition)(newScreen, x, y, TRUE);
}
else if (!PointerConfinedToScreen())
@@ -1919,6 +2279,25 @@ ProcWarpPointer(client)
return Success;
}
+static Bool
+BorderSizeNotEmpty(WindowPtr pWin)
+{
+ if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize))
+ return TRUE;
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension && PanoramiXSetWindowPntrs(pWin)) {
+ int i;
+
+ for(i = 1; i < PanoramiXNumScreens; i++) {
+ if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize))
+ return TRUE;
+ }
+ }
+#endif
+ return FALSE;
+}
+
/* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a
passive grab set on the window to be activated. */
@@ -1980,9 +2359,8 @@ CheckPassiveGrabsOnWindow(pWin, device, xE, count)
#endif
if (GrabMatchesSecond(&tempGrab, grab) &&
(!grab->confineTo ||
- (grab->confineTo->realized &&
- REGION_NOTEMPTY( grab->confineTo->drawable.pScreen,
- &grab->confineTo->borderSize))))
+ (grab->confineTo->realized &&
+ BorderSizeNotEmpty(grab->confineTo))))
{
#ifdef XCSECURITY
if (!SecurityCheckDeviceAccess(wClient(pWin), device, FALSE))
@@ -1990,8 +2368,8 @@ CheckPassiveGrabsOnWindow(pWin, device, xE, count)
#endif
#ifdef XKB
if (!noXkbExtension) {
- xE->u.keyButtonPointer.state &= 0x1f00;
- xE->u.keyButtonPointer.state |=
+ XE_KBPTR.state &= 0x1f00;
+ XE_KBPTR.state |=
tempGrab.modifiersDetail.exact&(~0x1f00);
}
#endif
@@ -2045,10 +2423,6 @@ CheckDeviceGrabs(device, xE, checkFirst, count)
int count;
{
register int i;
-#ifdef PANORAMIX
- register int j,k;
- PanoramiXWindow *pPanoramiXWin = NULL;
-#endif
register WindowPtr pWin;
register FocusClassPtr focus = device->focus;
@@ -2063,24 +2437,6 @@ CheckDeviceGrabs(device, xE, checkFirst, count)
if (focus)
{
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- k = (ROOT->drawable.pScreen)->myNum;
- for (; i < focus->traceGood; i++)
- {
- pWin = focus->trace[i];
- pPanoramiXWin = PanoramiXWinRoot;
- PANORAMIXFIND_ID(pPanoramiXWin, pWin->drawable.id);
- if (pPanoramiXWin) {
- pWin = (WindowPtr)
- LookupIDByType(pPanoramiXWin->info[k].id, RT_WINDOW);
- }
- if ( pWin && pWin->optional &&
- CheckPassiveGrabsOnWindow(pWin, device, xE, count))
- return TRUE;
- }
- }else {
-#endif
for (; i < focus->traceGood; i++)
{
pWin = focus->trace[i];
@@ -2088,35 +2444,13 @@ CheckDeviceGrabs(device, xE, checkFirst, count)
CheckPassiveGrabsOnWindow(pWin, device, xE, count))
return TRUE;
}
-#ifdef PANORAMIX
- }
-#endif
if ((focus->win == NoneWin) ||
(i >= spriteTraceGood) ||
((i > checkFirst) && (pWin != spriteTrace[i-1])))
return FALSE;
}
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- k = (ROOT->drawable.pScreen)->myNum;;
- for (; i < spriteTraceGood; i++) {
- pWin = spriteTrace[i];
- pPanoramiXWin = PanoramiXWinRoot;
- PANORAMIXFIND_ID_BY_SCRNUM(pPanoramiXWin, pWin->drawable.id, k);
- if (pPanoramiXWin) {
- for ( j= PanoramiXNumScreens - 1; j>=0; j--) {
- pWin = (WindowPtr)
- LookupIDByType(pPanoramiXWin->info[j].id, RT_WINDOW);
- if ( pWin && pWin->optional &&
- CheckPassiveGrabsOnWindow(pWin, device, xE, count))
- return TRUE;
- }
- }
- }
- return FALSE;
- }else {
-#endif
+
for (; i < spriteTraceGood; i++)
{
pWin = spriteTrace[i];
@@ -2126,9 +2460,6 @@ CheckDeviceGrabs(device, xE, checkFirst, count)
}
return FALSE;
-#ifdef PANORAMIX
- }
-#endif
}
void
@@ -2140,11 +2471,6 @@ DeliverFocusedEvent(keybd, xE, window, count)
{
WindowPtr focus = keybd->focus->win;
int mskidx = 0;
-#ifdef PANORAMIX
- register int k;
- WindowPtr orig_focus;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
if (focus == FollowKeyboardWin)
focus = inputInfo.keyboard->focus->win;
@@ -2155,27 +2481,12 @@ DeliverFocusedEvent(keybd, xE, window, count)
DeliverDeviceEvents(window, xE, NullGrab, NullWindow, keybd, count);
return;
}
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- k = (ROOT->drawable.pScreen)->myNum;
- orig_focus = focus;
- PANORAMIXFIND_ID(pPanoramiXWin, focus->drawable.id);
- if (pPanoramiXWin) {
- focus = (WindowPtr) LookupIDByType(pPanoramiXWin->info[k].id, RT_WINDOW);
- }
- }
-#endif
if ((focus == window) || IsParent(focus, window))
{
if (DeliverDeviceEvents(window, xE, NullGrab, focus, keybd, count))
return;
}
/* just deliver it to the focus window */
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- focus = orig_focus;
- }
-#endif
FixUpEventFromWindow(xE, focus, None, FALSE);
if (xE->u.u.type & EXTENSION_EVENT_BASE)
mskidx = keybd->id;
@@ -2298,10 +2609,9 @@ ProcessKeyboardEvent (xE, keybd, count)
CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
}
}
- xE->u.keyButtonPointer.state = (keyc->state |
- inputInfo.pointer->button->state);
- xE->u.keyButtonPointer.rootX = sprite.hot.x;
- xE->u.keyButtonPointer.rootY = sprite.hot.y;
+ XE_KBPTR.state = (keyc->state | inputInfo.pointer->button->state);
+ XE_KBPTR.rootX = sprite.hot.x;
+ XE_KBPTR.rootY = sprite.hot.y;
key = xE->u.u.detail;
kptr = &keyc->down[key >> 3];
bit = 1 << (key & 7);
@@ -2397,7 +2707,7 @@ ProcessPointerEvent (xE, mouse, count)
if (!syncEvents.playingEvents)
NoticeTime(xE)
- xE->u.keyButtonPointer.state = (butc->state | (
+ XE_KBPTR.state = (butc->state | (
#ifdef XKB
(noXkbExtension ?
inputInfo.keyboard->key->state :
@@ -2413,7 +2723,7 @@ ProcessPointerEvent (xE, mouse, count)
DeviceEventInfoRec eventinfo;
/* see comment in EnqueueEvents regarding the next three lines */
if (xE->u.u.type == MotionNotify)
- xE->u.keyButtonPointer.root =
+ XE_KBPTR.root =
WindowTable[sprite.hotPhys.pScreen->myNum]->drawable.id;
eventinfo.events = xE;
eventinfo.count = count;
@@ -2425,53 +2735,10 @@ ProcessPointerEvent (xE, mouse, count)
register int key;
register BYTE *kptr;
int bit;
-#ifdef PANORAMIX
- int j;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
- int x_off = 0, y_off = 0;
-#endif
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ) {
- for (j = PanoramiXNumScreens - 1; j; j--) {
- if (xE->u.keyButtonPointer.root == PanoramiXWinRoot->info[j].id)
- break;
- }
- if (j) {
- xE->u.keyButtonPointer.root = PanoramiXWinRoot->info[0].id;
- xE->u.keyButtonPointer.sameScreen = xTrue;
- }
-
- PANORAMIXFIND_ID(pPanoramiXWin, xE->u.keyButtonPointer.event);
- if (pPanoramiXWin) {
- for (j = PanoramiXNumScreens - 1; j; j--) {
- if (pPanoramiXWin->info[j].id == xE->u.keyButtonPointer.event)
- break;
- }
- }
- if (j && pPanoramiXWin) {
- xE->u.keyButtonPointer.event = pPanoramiXWin->info[0].id;
- }
- pPanoramiXWin = PanoramiXWinRoot;
- PANORAMIXFIND_ID(pPanoramiXWin, xE->u.keyButtonPointer.child);
- if (pPanoramiXWin) {
- for (j = PanoramiXNumScreens - 1; j; j--) {
- if (pPanoramiXWin->info[j].id == xE->u.keyButtonPointer.child)
- break;
- }
- }
- if (j && pPanoramiXWin)
- xE->u.keyButtonPointer.child = pPanoramiXWin->info[0].id;
-
- xE->u.keyButtonPointer.rootX = sprite.hot.x;
- xE->u.keyButtonPointer.rootY = sprite.hot.y;
- }else {
-#endif
- xE->u.keyButtonPointer.rootX = sprite.hot.x;
- xE->u.keyButtonPointer.rootY = sprite.hot.y;
-#ifdef PANORAMIX
- }
-#endif
+ XE_KBPTR.rootX = sprite.hot.x;
+ XE_KBPTR.rootY = sprite.hot.y;
+
key = xE->u.u.detail;
kptr = &butc->down[key >> 3];
bit = 1 << (key & 7);
@@ -3050,16 +3317,11 @@ DoFocusEvents(dev, fromWin, toWin, mode)
/* Notify all the roots */
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusOut, mode, out,
- WindowTable[sprite.hotPhys.pScreen->myNum]);
- else {
+ FocusEvent(dev, FocusOut, mode, out, WindowTable[0]);
+ else
+#endif
for (i=0; i<screenInfo.numScreens; i++)
FocusEvent(dev, FocusOut, mode, out, WindowTable[i]);
- }
-#else
- for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusOut, mode, out, WindowTable[i]);
-#endif
}
else
{
@@ -3074,16 +3336,11 @@ DoFocusEvents(dev, fromWin, toWin, mode)
/* Notify all the roots */
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusIn, mode, in,
- WindowTable[sprite.hotPhys.pScreen->myNum]);
- else {
+ FocusEvent(dev, FocusIn, mode, in, WindowTable[0]);
+ else
+#endif
for (i=0; i<screenInfo.numScreens; i++)
FocusEvent(dev, FocusIn, mode, in, WindowTable[i]);
- }
-#else
- for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusIn, mode, in, WindowTable[i]);
-#endif
if (toWin == PointerRootWin)
(void)FocusInEvents(dev, ROOT, sprite.win, NullWindow, mode,
NotifyPointer, TRUE);
@@ -3097,16 +3354,11 @@ DoFocusEvents(dev, fromWin, toWin, mode)
TRUE);
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
- FocusEvent(dev, FocusOut, mode, out,
- WindowTable[sprite.hotPhys.pScreen->myNum]);
- else {
+ FocusEvent(dev, FocusOut, mode, out, WindowTable[0]);
+ else
+#endif
for (i=0; i<screenInfo.numScreens; i++)
FocusEvent(dev, FocusOut, mode, out, WindowTable[i]);
- }
-#else
- for (i=0; i<screenInfo.numScreens; i++)
- FocusEvent(dev, FocusOut, mode, out, WindowTable[i]);
-#endif
if (toWin->parent != NullWindow)
(void)FocusInEvents(dev, ROOT, toWin, toWin, mode,
NotifyNonlinearVirtual, TRUE);
@@ -3256,24 +3508,6 @@ SetInputFocus(client, dev, focusID, revertTo, ctime, followOK)
return Success;
}
-#ifdef PANORAMIX
-int PanoramiXSetInputFocus(ClientPtr client)
-{
- REQUEST(xSetInputFocusReq);
- int j, result;
- Window winID;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-
- REQUEST_SIZE_MATCH(xSetInputFocusReq);
- j = (sprite.hotPhys.pScreen)->myNum;
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->focus);
- winID = pPanoramiXWin ? pPanoramiXWin->info[j].id : stuff->focus;
- result = SetInputFocus(client, inputInfo.keyboard, winID, stuff->revertTo,
- stuff->time, FALSE);
- return(result);
-}
-#endif
-
int
ProcSetInputFocus(client)
ClientPtr client;
@@ -3281,10 +3515,6 @@ ProcSetInputFocus(client)
REQUEST(xSetInputFocusReq);
REQUEST_SIZE_MATCH(xSetInputFocusReq);
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return PanoramiXSetInputFocus(client);
-#endif
#ifdef XCSECURITY
if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE))
return Success;
@@ -3293,36 +3523,6 @@ ProcSetInputFocus(client)
stuff->revertTo, stuff->time, FALSE);
}
-#ifdef PANORAMIX
-int PanoramiXGetInputFocus(ClientPtr client)
-{
- xGetInputFocusReply rep;
- REQUEST(xReq);
- int j;
- FocusClassPtr focus = inputInfo.keyboard->focus;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-
- REQUEST_SIZE_MATCH(xReq);
- j = (sprite.hotPhys.pScreen)->myNum;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (focus->win == NoneWin)
- rep.focus = None;
- else if (focus->win == PointerRootWin)
- rep.focus = PointerRoot;
- else{
- rep.focus = focus->win->drawable.id;
- PANORAMIXFIND_ID_BY_SCRNUM(pPanoramiXWin, focus->win->drawable.id, j);
- if (pPanoramiXWin)
- rep.focus = pPanoramiXWin->info[0].id;
- }
- rep.revertTo = focus->revert;
- WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep);
- return Success;
-}
-#endif
-
int
ProcGetInputFocus(client)
ClientPtr client;
@@ -3332,10 +3532,6 @@ ProcGetInputFocus(client)
FocusClassPtr focus = inputInfo.keyboard->focus;
REQUEST_SIZE_MATCH(xReq);
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return PanoramiXGetInputFocus(client);
-#endif
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
@@ -3360,20 +3556,9 @@ ProcGrabPointer(client)
CursorPtr cursor, oldCursor;
REQUEST(xGrabPointerReq);
TimeStamp time;
-#ifdef PANORAMIX
- int j,i, PanoramiXNum;
- Bool NotViewable, NotRealized;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
REQUEST_SIZE_MATCH(xGrabPointerReq);
UpdateCurrentTime();
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ) {
- PanoramiXNum = (sprite.hotPhys.pScreen)->myNum;
- NotViewable = FALSE;
- }
-#endif
if ((stuff->pointerMode != GrabModeSync) &&
(stuff->pointerMode != GrabModeAsync))
{
@@ -3399,45 +3584,10 @@ ProcGrabPointer(client)
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
if (!pWin)
return BadWindow;
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ) {
- pPanoramiXWin = PanoramiXWinRoot;
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->grabWindow);
- if (pPanoramiXWin) {
- pWin = SecurityLookupWindow(pPanoramiXWin->info[PanoramiXNum].id, client,
- SecurityReadAccess);
- if (!pWin)
- return BadWindow;
- }
- if (stuff->confineTo == PanoramiXWinRoot->info[0].id)
- stuff->confineTo = None;
- }
-#endif
if (stuff->confineTo == None)
confineTo = NullWindow;
-#ifdef PANORAMIX
- else if ( !noPanoramiXExtension ) {
- if (stuff->confineTo) {
- pPanoramiXWin = PanoramiXWinRoot;
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->confineTo);
- if (pPanoramiXWin) {
- stuff->confineTo = pPanoramiXWin->info[sprite.hotPhys.pScreen->
-myNum].id;
- confineTo = SecurityLookupWindow(stuff->confineTo, client,
- SecurityReadAccess);
- if (!confineTo)
- return BadWindow;
- }
- if ((confineTo && !(confineTo->realized &&
- REGION_NOTEMPTY(confineTo->drawable.pScreen, &confineTo->
-borderSize))))
- NotViewable = TRUE;
- }
- } else {
-#else
else
{
-#endif
confineTo = SecurityLookupWindow(stuff->confineTo, client,
SecurityReadAccess);
if (!confineTo)
@@ -3463,22 +3613,9 @@ borderSize))))
grab = device->grab;
if ((grab) && !SameClient(grab, client))
rep.status = AlreadyGrabbed;
-#ifdef PANORAMIX
- else if ((!noPanoramiXExtension ) &&
- (!(pWin->realized) || NotViewable))
- rep.status = GrabNotViewable;
- else if ((noPanoramiXExtension) && (!pWin->realized) ||
- (confineTo &&
- !(confineTo->realized &&
- REGION_NOTEMPTY( confineTo->drawable.pScreen,
- &confineTo->borderSize))))
-#else
else if ((!pWin->realized) ||
(confineTo &&
- !(confineTo->realized &&
- REGION_NOTEMPTY( confineTo->drawable.pScreen,
- &confineTo->borderSize))))
-#endif
+ !(confineTo->realized && BorderSizeNotEmpty(confineTo))))
rep.status = GrabNotViewable;
else if (device->sync.frozen &&
device->sync.other && !SameClient(device->sync.other, client))
@@ -3654,11 +3791,6 @@ ProcGrabKeyboard(client)
xGrabKeyboardReply rep;
REQUEST(xGrabKeyboardReq);
int result;
-#ifdef PANORAMIX
- int PanoramiXNum;
- Window winID;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
REQUEST_SIZE_MATCH(xGrabKeyboardReq);
#ifdef XCSECURITY
@@ -3669,14 +3801,6 @@ ProcGrabKeyboard(client)
}
else
#endif
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- PanoramiXNum = (sprite.hotPhys.pScreen)->myNum;
- winID = stuff->grabWindow;
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->grabWindow);
- stuff->grabWindow = pPanoramiXWin ? pPanoramiXWin->info[PanoramiXNum].id : winID;
- }
-#endif
result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode,
stuff->pointerMode, stuff->grabWindow,
stuff->ownerEvents, stuff->time,
@@ -3718,71 +3842,32 @@ ProcQueryPointer(client)
WindowPtr pWin, t;
REQUEST(xResourceReq);
DeviceIntPtr mouse = inputInfo.pointer;
-#ifdef PANORAMIX
- int PanoramiXNum;
- Window winID;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
REQUEST_SIZE_MATCH(xResourceReq);
pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess);
if (!pWin)
return BadWindow;
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ){
- t = sprite.win;
- PanoramiXNum = (sprite.hotPhys.pScreen)->myNum;
- if (t == pWin) {
- /* we probably want pWin of some Fake Window */
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->id);
- winID = pPanoramiXWin ? pPanoramiXWin->info[PanoramiXNum].id : stuff->id;
- pWin = SecurityLookupWindow(winID, client, SecurityReadAccess);
- }
- }
-#endif
if (mouse->valuator->motionHintWindow)
MaybeStopHint(mouse, client);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.mask = mouse->button->state | inputInfo.keyboard->key->state;
rep.length = 0;
+ rep.root = (ROOT)->drawable.id;
+ rep.rootX = sprite.hot.x;
+ rep.rootY = sprite.hot.y;
#ifdef PANORAMIX
- if ( !noPanoramiXExtension ){
- rep.root = PanoramiXWinRoot->info[0].id;
- rep.rootX = sprite.hot.x + panoramiXdataPtr[PanoramiXNum].x;
- rep.rootY = sprite.hot.y + panoramiXdataPtr[PanoramiXNum].y;
- } else {
-#endif
- rep.root = (ROOT)->drawable.id;
- rep.rootX = sprite.hot.x;
- rep.rootY = sprite.hot.y;
-#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ rep.rootX += panoramiXdataPtr[0].x;
+ rep.rootY += panoramiXdataPtr[0].y;
}
#endif
rep.child = None;
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ){
- rep.sameScreen = xTrue;
- rep.winX = sprite.hot.x - pWin->drawable.x + panoramiXdataPtr[PanoramiXNum].x;
- rep.winY = sprite.hot.y - pWin->drawable.y + panoramiXdataPtr[PanoramiXNum].y;
- for (; pPanoramiXWin &&
- ((unsigned long)LookupIDByType(pPanoramiXWin->info[PanoramiXNum].id,
- RT_WINDOW) != (unsigned long) t); pPanoramiXWin = pPanoramiXWin->next);
- if (pPanoramiXWin)
- t = (WindowPtr)LookupIDByType(pPanoramiXWin->info[0].id, RT_WINDOW);
- for (; t; t = t->parent) {
- if (t->parent == pWin) {
- rep.child = t->drawable.id;
- break;
- }
- }
- } else {
-#endif
if (sprite.hot.pScreen == pWin->drawable.pScreen)
{
rep.sameScreen = xTrue;
rep.winX = sprite.hot.x - pWin->drawable.x;
- rep.winY = sprite.hot.y - pWin->drawable.y;
+ rep.winY =sprite.hot.y - pWin->drawable.y;
for (t = sprite.win; t; t = t->parent)
if (t->parent == pWin)
{
@@ -3796,9 +3881,6 @@ ProcQueryPointer(client)
rep.winX = 0;
rep.winY = 0;
}
-#ifdef PANORAMIX
- }
-#endif
WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep);
@@ -3926,9 +4008,6 @@ ProcSendEvent(client)
stuff->event.u.u.type |= 0x80;
if (stuff->propagate)
{
-#ifdef PANORAMIX
- if (noPanoramiXExtension){
-#endif
for (;pWin; pWin = pWin->parent)
{
if (DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask,
@@ -3940,14 +4019,8 @@ ProcSendEvent(client)
if (!stuff->eventMask)
break;
}
-#ifdef PANORAMIX
- }
-#endif
}
else
-#ifdef PANORAMIX
- if (noPanoramiXExtension)
-#endif
(void)DeliverEventsToWindow(pWin, &stuff->event, 1, stuff->eventMask,
NullGrab, 0);
return Success;
@@ -3961,13 +4034,6 @@ ProcUngrabKey(client)
WindowPtr pWin;
GrabRec tempGrab;
DeviceIntPtr keybd = inputInfo.keyboard;
-#ifdef PANORAMIX
- int i;
- Bool result, anyTrue;
- Window GrabWinID;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
- register GrabPtr grab;
-#endif
REQUEST_SIZE_MATCH(xUngrabKeyReq);
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
@@ -3997,31 +4063,9 @@ ProcUngrabKey(client)
tempGrab.detail.exact = stuff->key;
tempGrab.detail.pMask = NULL;
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ){
- anyTrue = FALSE;
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->grabWindow);
- FOR_NSCREENS_OR_ONCE(pPanoramiXWin, i) {
- GrabWinID = pPanoramiXWin ?
- pPanoramiXWin->info[i].id : stuff->grabWindow;
- pWin = SecurityLookupWindow(GrabWinID, client, SecurityReadAccess);
- tempGrab.window = pWin;
- result = DeletePassiveGrabFromList(&tempGrab);
- if (result == TRUE)
- anyTrue = result;
- }
- if (anyTrue)
- return(Success);
- else
- return(BadAlloc);
- }else {
-#endif
if (!DeletePassiveGrabFromList(&tempGrab))
return(BadAlloc);
return(Success);
-#ifdef PANORAMIX
- }
-#endif
}
int
@@ -4032,11 +4076,6 @@ ProcGrabKey(client)
REQUEST(xGrabKeyReq);
GrabPtr grab;
DeviceIntPtr keybd = inputInfo.keyboard;
-#ifdef PANORAMIX
- int i, result, anySuccess;
- Window GrabWinID;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
REQUEST_SIZE_MATCH(xGrabKeyReq);
if ((stuff->ownerEvents != xTrue) && (stuff->ownerEvents != xFalse))
@@ -4072,40 +4111,15 @@ ProcGrabKey(client)
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
if (!pWin)
return BadWindow;
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ){
- anySuccess = BadAccess;
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->grabWindow);
- FOR_NSCREENS_OR_ONCE(pPanoramiXWin, i) {
- GrabWinID = pPanoramiXWin ?
- pPanoramiXWin->info[i].id : stuff->grabWindow;
- pWin = SecurityLookupWindow(GrabWinID, client, SecurityReadAccess);
- grab = CreateGrab(client->index, keybd, pWin,
- (Mask)(KeyPressMask | KeyReleaseMask),
- (Bool)stuff->ownerEvents,
- (Bool)stuff->keyboardMode,
- (Bool)stuff->pointerMode,
- keybd, stuff->modifiers, KeyPress,
- stuff->key, NullWindow, NullCursor);
- if (!grab)
- return BadAlloc;
- result = AddPassiveGrabToList(grab);
- if (result == Success)
- anySuccess = result;
- }
- return (anySuccess);
- }else {
-#endif
+
grab = CreateGrab(client->index, keybd, pWin,
(Mask)(KeyPressMask | KeyReleaseMask), (Bool)stuff->ownerEvents,
(Bool)stuff->keyboardMode, (Bool)stuff->pointerMode,
- keybd, stuff->modifiers, KeyPress, stuff->key, NullWindow, NullCursor);
+ keybd, stuff->modifiers, KeyPress, stuff->key,
+ NullWindow, NullCursor);
if (!grab)
return BadAlloc;
return AddPassiveGrabToList(grab);
-#ifdef PANORAMIX
- }
-#endif
}
@@ -4117,19 +4131,8 @@ ProcGrabButton(client)
REQUEST(xGrabButtonReq);
CursorPtr cursor;
GrabPtr grab;
-#ifdef PANORAMIX
- int i, result, anySuccess;
- Bool NotViewable, NotRealized;
- Window GrabWinID;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
-#endif
REQUEST_SIZE_MATCH(xGrabButtonReq);
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ) {
- NotViewable = FALSE;
- }
-#endif
if ((stuff->pointerMode != GrabModeSync) &&
(stuff->pointerMode != GrabModeAsync))
{
@@ -4161,44 +4164,9 @@ ProcGrabButton(client)
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
if (!pWin)
return BadWindow;
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension ){
- if (stuff->confineTo == PanoramiXWinRoot->info[0].id)
- stuff->confineTo = None;
- }
-#endif
if (stuff->confineTo == None)
confineTo = NullWindow;
-#ifdef PANORAMIX
- else if ( !noPanoramiXExtension ) {
- if (stuff->confineTo) {
- pPanoramiXWin = PanoramiXWinRoot;
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->confineTo);
- if (pPanoramiXWin) {
- for ( i = PanoramiXNumScreens - 1; i >=0 ; i--) {
- stuff->confineTo = pPanoramiXWin->info[i].id;
- confineTo = SecurityLookupWindow(stuff->confineTo, client,
- SecurityReadAccess);
- if (!confineTo)
- return BadWindow;
- /* find where confined windows top-left corner lies
- and based on its coordinates choose the window
- which is truly seen. Then check realized/empty
- and pass this window to activate grab. */
- if ((confineTo->drawable.x >= 0) &&
- (confineTo->drawable.x <= panoramiXdataPtr[i].x))
- break;
- }
- } else
- confineTo = SecurityLookupWindow(stuff->confineTo, client,
- SecurityReadAccess);
- if (!confineTo)
- return BadWindow;
- }
- } else {
-#else
else {
-#endif
confineTo = SecurityLookupWindow(stuff->confineTo, client,
SecurityReadAccess);
if (!confineTo)
@@ -4217,45 +4185,17 @@ ProcGrabButton(client)
}
}
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- anySuccess = BadAccess;
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->grabWindow);
- FOR_NSCREENS_OR_ONCE(pPanoramiXWin, i) {
- GrabWinID = pPanoramiXWin ?
- pPanoramiXWin->info[i].id : stuff->grabWindow;
- pWin = SecurityLookupWindow(GrabWinID, client, SecurityReadAccess);
- grab = CreateGrab(client->index, inputInfo.pointer, pWin,
- permitOldBugs ? (Mask)(stuff->eventMask |
- ButtonPressMask | ButtonReleaseMask) :
- (Mask)stuff->eventMask,
- (Bool)stuff->ownerEvents,
- (Bool) stuff->keyboardMode,
- (Bool)stuff->pointerMode,
- inputInfo.keyboard, stuff->modifiers,
- ButtonPress, stuff->button, confineTo, cursor);
- if (!grab)
- return BadAlloc;
- result = AddPassiveGrabToList(grab);
- if (result == Success)
- anySuccess = result;
- }
- return (anySuccess);
- }else {
-#endif
- grab = CreateGrab(client->index, inputInfo.pointer, pWin,
- permitOldBugs ? (Mask)(stuff->eventMask |
+
+ grab = CreateGrab(client->index, inputInfo.pointer, pWin,
+ permitOldBugs ? (Mask)(stuff->eventMask |
ButtonPressMask | ButtonReleaseMask) :
(Mask)stuff->eventMask,
(Bool)stuff->ownerEvents, (Bool) stuff->keyboardMode,
(Bool)stuff->pointerMode, inputInfo.keyboard, stuff->modifiers,
ButtonPress, stuff->button, confineTo, cursor);
- if (!grab)
+ if (!grab)
return BadAlloc;
- return AddPassiveGrabToList(grab);
-#ifdef PANORAMIX
- }
-#endif
+ return AddPassiveGrabToList(grab);
}
int
@@ -4265,13 +4205,6 @@ ProcUngrabButton(client)
REQUEST(xUngrabButtonReq);
WindowPtr pWin;
GrabRec tempGrab;
-#ifdef PANORAMIX
- int i;
- Bool result, anyTrue;
- Window GrabWinID;
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
- register GrabPtr grab;
-#endif
REQUEST_SIZE_MATCH(xUngrabButtonReq);
if ((stuff->modifiers != AnyModifier) &&
@@ -4293,31 +4226,9 @@ ProcUngrabButton(client)
tempGrab.detail.exact = stuff->button;
tempGrab.detail.pMask = NULL;
-#ifdef PANORAMIX
- anyTrue = FALSE;
- if ( !noPanoramiXExtension ){
- PANORAMIXFIND_ID(pPanoramiXWin, stuff->grabWindow);
- FOR_NSCREENS_OR_ONCE(pPanoramiXWin, i) {
- GrabWinID = pPanoramiXWin ?
- pPanoramiXWin->info[i].id : stuff->grabWindow;
- pWin = SecurityLookupWindow(GrabWinID, client, SecurityReadAccess);
- tempGrab.window = pWin;
- result = DeletePassiveGrabFromList(&tempGrab);
- if (result == TRUE)
- anyTrue = result;
- }
- if (anyTrue)
- return (Success);
- else
- return (BadAlloc);
- }else {
-#endif
- if (!DeletePassiveGrabFromList(&tempGrab))
+ if (!DeletePassiveGrabFromList(&tempGrab))
return(BadAlloc);
- return(Success);
-#ifdef PANORAMIX
- }
-#endif
+ return(Success);
}
void
@@ -4420,10 +4331,13 @@ CheckCursorConfinement(pWin)
GrabPtr grab = inputInfo.pointer->grab;
WindowPtr confineTo;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return;
+#endif
+
if (grab && (confineTo = grab->confineTo))
{
- if (!REGION_NOTEMPTY( confineTo->drawable.pScreen,
- &confineTo->borderSize))
+ if (!BorderSizeNotEmpty(confineTo))
(*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer);
else if ((pWin == confineTo) || IsParent(pWin, confineTo))
ConfineCursorToWindow(confineTo, TRUE, TRUE);
@@ -4454,6 +4368,7 @@ ProcRecolorCursor(client)
CursorPtr pCursor;
int nscr;
ScreenPtr pscr;
+ Bool displayed;
REQUEST(xRecolorCursorReq);
REQUEST_SIZE_MATCH(xRecolorCursorReq);
@@ -4476,9 +4391,14 @@ ProcRecolorCursor(client)
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
{
pscr = screenInfo.screens[nscr];
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension)
+ displayed = (pscr == sprite.screen);
+ else
+#endif
+ displayed = (pscr == sprite.hotPhys.pScreen);
( *pscr->RecolorCursor)(pscr, pCursor,
- (pCursor == sprite.current) &&
- (pscr == sprite.hotPhys.pScreen));
+ (pCursor == sprite.current) && displayed);
}
return (Success);
}
@@ -4491,164 +4411,6 @@ WriteEventsToClient(pClient, count, events)
{
xEvent eventTo, *eventFrom;
int i;
-#ifdef PANORAMIX
- PanoramiXWindow *pPanoramiXWin = PanoramiXWinRoot;
- int x_off = 0, y_off = 0;
- int j,NewId,OrigId;
-#endif
-
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- switch (events->u.u.type) {
- case ButtonPress : case ButtonRelease :
- case MotionNotify : case KeyPress :
- FORCE_ROOT(events->u.keyButtonPointer, j);
- events->u.keyButtonPointer.sameScreen = xTrue;
- for (i = 0; i < count; i++) {
- FORCE_WIN(events[i].u.keyButtonPointer.event, j);
- if (events[i].u.keyButtonPointer.child) {
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events[i].u.keyButtonPointer.child, j);
- }
- }
- break;
- case EnterNotify : case LeaveNotify :
- FORCE_ROOT(events->u.enterLeave, j);
- for (i = 0; i < count; i++) {
- FORCE_WIN(events[i].u.enterLeave.event, j);
- if (events[i].u.enterLeave.child) {
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events[i].u.enterLeave.child, j);
- }
- }
- break;
- case Expose :
- /* Need to do this count time, ensure no fake
- window ideas are send to client */
- for (i = 0; i < count; i++)
- FORCE_WIN(events[i].u.expose.window, j);
- break;
- case FocusOut :
- FORCE_WIN(events->u.focus.window, j);
- break;
- case FocusIn :
- FORCE_WIN(events->u.focus.window, j);
- break;
- case VisibilityNotify :
- FORCE_WIN(events->u.visibility.window, j);
- break;
- case GraphicsExpose :
- FORCE_WIN(events->u.graphicsExposure.drawable, j);
- break;
- case NoExpose :
- SKIP_FAKE_WINDOW(events->u.noExposure.drawable, j);
- break;
- case CreateNotify :
- FORCE_WIN(events->u.createNotify.parent, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.createNotify.window, j);
- break;
- case ColormapNotify :
- FORCE_WIN(events->u.colormap.window, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.colormap.colormap, j);
- break;
- case MapNotify :
- SKIP_FAKE_WINDOW(events->u.mapNotify.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.mapNotify.window, j);
- break;
- case UnmapNotify :
- SKIP_FAKE_WINDOW(events->u.unmapNotify.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.unmapNotify.window, j);
- break;
- case DestroyNotify :
- SKIP_FAKE_WINDOW(events->u.destroyNotify.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.destroyNotify.window, j);
- break;
- case GravityNotify :
- FORCE_WIN(events->u.gravity.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.gravity.window, j);
- break;
- case MapRequest :
- SKIP_FAKE_WINDOW(events->u.mapRequest.parent, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.mapRequest.window, j);
- break;
- case ConfigureNotify :
- FORCE_WIN(events->u.configureNotify.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.configureNotify.window, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.configureNotify.aboveSibling, j);
- break;
- case ConfigureRequest :
- SKIP_FAKE_WINDOW(events->u.configureRequest.parent, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.configureRequest.window, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.configureRequest.sibling, j);
- break;
- case ResizeRequest :
- FORCE_WIN(events->u.resizeRequest.window, j);
- break;
- case CirculateNotify : case CirculateRequest :
- case ReparentNotify :
- FORCE_WIN(events->u.circulate.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.circulate.window, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.circulate.parent, j);
- break;
- case PropertyNotify :
- SKIP_FAKE_WINDOW(events->u.property.window, j);
- break;
- case ClientMessage :
- SKIP_FAKE_WINDOW(events->u.clientMessage.window, j);
- break;
- default :
- switch (events->u.u.type & ~0x80) {
- case VisibilityNotify :
- FORCE_WIN(events->u.visibility.window, j);
- break;
- case MapNotify :
- SKIP_FAKE_WINDOW(events->u.mapNotify.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.mapNotify.window, j);
- break;
- case UnmapNotify :
- SKIP_FAKE_WINDOW(events->u.unmapNotify.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.unmapNotify.window, j);
- case MapRequest :
- SKIP_FAKE_WINDOW(events->u.mapRequest.parent, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.mapRequest.window, j);
- break;
- case ConfigureNotify :
- FORCE_WIN(events->u.configureNotify.event, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.configureNotify.window, j);
- pPanoramiXWin = PanoramiXWinRoot;
- FORCE_WIN(events->u.configureNotify.aboveSibling, j);
- break;
- case ConfigureRequest :
- SKIP_FAKE_WINDOW(events->u.configureRequest.parent, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.configureRequest.window, j);
- pPanoramiXWin = PanoramiXWinRoot;
- SKIP_FAKE_WINDOW(events->u.configureRequest.sibling, j);
- break;
- default :
- break;
- } /* default case */
- break;
- } /* case */
- }
-#endif
#ifdef XKB
if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events)))