diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-18 19:32:17 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-18 19:32:17 +0000 |
commit | 4b75c7f6358b28978b05ffa4b73853d936454f50 (patch) | |
tree | fcaa243699c1f97e88799d303c0cc81a06b08de4 /dix | |
parent | 8a7481a27496c842ec2ef5bac5e4d0b5e6279deb (diff) |
First pass at "Standard" Xinerama. The sources for this came from Heather
Lanigan's xinerama tree on Sourceforge.Net. No attempt has been made to
handle previous, non-standard versions of the protocol. Nor has any
attempt been made to preserve the ABI of previous versions -- that part
will be added at a later time, and then probably only on systems that
have nice object/linker semantics, e.g. ELF systems with weak symbols.
Diffstat (limited to 'dix')
-rw-r--r-- | dix/colormap.c | 37 | ||||
-rw-r--r-- | dix/dispatch.c | 31 | ||||
-rw-r--r-- | dix/dixfonts.c | 10 | ||||
-rw-r--r-- | dix/events.c | 297 | ||||
-rw-r--r-- | dix/main.c | 31 | ||||
-rw-r--r-- | dix/resource.c | 17 | ||||
-rw-r--r-- | dix/window.c | 57 |
7 files changed, 262 insertions, 218 deletions
diff --git a/dix/colormap.c b/dix/colormap.c index af959ed86..f3080471a 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -1,3 +1,4 @@ +/* $XdotOrg$ */ /* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.12 2003/11/17 22:20:33 dawes Exp $ */ /*********************************************************** @@ -61,6 +62,11 @@ SOFTWARE. #ifdef LBX #include "lbxserve.h" #endif +#ifdef XINERAMA +#include "xinerama.h" +#include "xineramaSrv.h" +extern Bool noXineramaExtension; +#endif extern XID clientErrorValue; extern int colormapPrivateCount; @@ -474,16 +480,23 @@ TellNoMap (pwin, pmid) if (wColormap(pwin) == *pmid) { +#ifdef XINERAMA + /* + * Only deliver event for Screen 0 when Xinerama enabled + */ + if (noXineramaExtension || + (!noXineramaExtension && !(pwin->drawable.pScreen->myNum))) { +#endif /* This should be call to DeliverEvent */ xE.u.u.type = ColormapNotify; xE.u.colormap.window = pwin->drawable.id; xE.u.colormap.colormap = None; xE.u.colormap.new = TRUE; xE.u.colormap.state = ColormapUninstalled; -#ifdef PANORAMIX - if(noPanoramiXExtension || !pwin->drawable.pScreen->myNum) + DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL); +#ifdef XINERAMA + } #endif - DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL); if (pwin->optional) { pwin->optional->colormap = None; CheckWindowOptionalNeed (pwin); @@ -502,9 +515,12 @@ TellLostMap (pwin, value) Colormap *pmid = (Colormap *)value; xEvent xE; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum) - return WT_STOPWALKING; +#ifdef XINERAMA + /* + * Only deliver event for Screen 0 when Xinerama enabled + */ + if (noXineramaExtension || + (!noXineramaExtension && !(pwin->drawable.pScreen->myNum))) #endif if (wColormap(pwin) == *pmid) { @@ -529,9 +545,12 @@ TellGainedMap (pwin, value) Colormap *pmid = (Colormap *)value; xEvent xE; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum) - return WT_STOPWALKING; +#ifdef XINERAMA + /* + * Only deliver event for Screen 0 when Xinerama enabled + */ + if (noXineramaExtension || + (!noXineramaExtension && !(pwin->drawable.pScreen->myNum))) #endif if (wColormap (pwin) == *pmid) { diff --git a/dix/dispatch.c b/dix/dispatch.c index cd1ce6790..ac573d235 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1,3 +1,4 @@ +/* $XdotOrg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ /* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ /************************************************************ @@ -46,7 +47,7 @@ SOFTWARE. ********************************************************/ -/* The panoramix components contained the following notice */ +/* The Xinerama components contained the following notice */ /**************************************************************** * * * Copyright (c) Digital Equipment Corporation, 1991, 1997 * @@ -70,7 +71,7 @@ SOFTWARE. /* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.33 2003/11/17 22:20:33 dawes Exp $ */ -#ifdef PANORAMIX_DEBUG +#ifdef XINERAMA_DEBUG #include <stdio.h> int ProcInitialConnection(); #endif @@ -91,9 +92,9 @@ int ProcInitialConnection(); #include "dispatch.h" #include "swaprep.h" #include "swapreq.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" +#ifdef XINERAMA +#include "xinerama.h" +#include "xineramaSrv.h" #endif #ifdef XCSECURITY #define _SECURITY_SERVER @@ -2641,8 +2642,8 @@ ProcAllocColor(client) else return (retval); } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pmap->pScreen->myNum) +#ifdef XINERAMA + if (noXineramaExtension || !pmap->pScreen->myNum) #endif WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); return (client->noClientException); @@ -2700,8 +2701,8 @@ ProcAllocNamedColor (client) else return(retval); } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) +#ifdef XINERAMA + if (noXineramaExtension || !pcmp->pScreen->myNum) #endif WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr); return (client->noClientException); @@ -2770,8 +2771,8 @@ ProcAllocColorCells (client) else return(retval); } -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) +#ifdef XINERAMA + if (noXineramaExtension || !pcmp->pScreen->myNum) #endif { accr.type = X_Reply; @@ -2849,8 +2850,8 @@ ProcAllocColorPlanes(client) return(retval); } acpr.length = length >> 2; -#ifdef PANORAMIX - if (noPanoramiXExtension || !pcmp->pScreen->myNum) +#ifdef XINERAMA + if (noXineramaExtension || !pcmp->pScreen->myNum) #endif { WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); @@ -3932,8 +3933,8 @@ SendConnSetup(client, reason) #endif /* fill in the "currentInputMask" */ root = (xWindowRoot *)(lConnectionInfo + connBlockScreenStart); -#ifdef PANORAMIX - if (noPanoramiXExtension) +#ifdef XINERAMA + if (noXineramaExtension) numScreens = screenInfo.numScreens; else numScreens = ((xConnSetup *)ConnectionInfo)->numRoots; diff --git a/dix/dixfonts.c b/dix/dixfonts.c index d971260c7..114dc5720 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1,3 +1,4 @@ +/* $XdotOrg: xc/programs/Xserver/dix/dixfonts.c,v 3.29 2003/11/17 22:20:34 dawes Exp $ */ /* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.29 2003/11/17 22:20:34 dawes Exp $ */ /************************************************************************ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -41,8 +42,9 @@ SOFTWARE. #include <stdio.h> #endif -#ifdef PANORAMIX -#include "panoramiX.h" +#ifdef XINERAMA +#include "xinerama.h" +extern Bool noXineramaExtension; #endif #ifdef LBX @@ -1398,8 +1400,8 @@ bail: if (c->err != Success) err = c->err; if (err != Success && c->client != serverClient) { -#ifdef PANORAMIX - if (noPanoramiXExtension || !c->pGC->pScreen->myNum) +#ifdef XINERAMA + if (noXineramaExtension || !c->pGC->pScreen->myNum) #endif SendErrorToClient(c->client, c->reqType, 0, 0, err); } diff --git a/dix/events.c b/dix/events.c index 2131b5fd4..2d16cc008 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1,3 +1,4 @@ +/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 3.50 2003/11/17 22:20:34 dawes Exp $ */ /* $XFree86: xc/programs/Xserver/dix/events.c,v 3.50 2003/11/17 22:20:34 dawes Exp $ */ /************************************************************ @@ -46,7 +47,7 @@ SOFTWARE. ********************************************************/ -/* The panoramix components contained the following notice */ +/* The Xinerama components contained the following notice */ /**************************************************************** * * * Copyright (c) Digital Equipment Corporation, 1991, 1997 * @@ -82,9 +83,9 @@ SOFTWARE. #include "cursorstr.h" #include "dixstruct.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" +#ifdef XINERAMA +#include "xinerama.h" +#include "xineramaSrv.h" #endif #include "globals.h" @@ -140,7 +141,6 @@ extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); #define XE_KBPTR (xE->u.keyButtonPointer) - #define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) CallbackListPtr EventCallback; @@ -183,14 +183,14 @@ static struct { CursorPtr current; BoxRec hotLimits; /* logical constraints of hot spot */ Bool confined; /* confined to screen */ -#if defined(SHAPE) || defined(PANORAMIX) +#if defined(SHAPE) || defined(XINERAMA) 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 +#ifdef XINERAMA ScreenPtr screen; /* all others are in Screen 0 coordinates */ RegionRec Reg1; /* Region 1 for confining motion */ RegionRec Reg2; /* Region 2 for confining virtual motion */ @@ -263,9 +263,8 @@ static CARD8 criticalEvents[32] = 0x7c /* key and button events */ }; -#ifdef PANORAMIX +#ifdef XINERAMA -static void ConfineToShape(RegionPtr shape, int *px, int *py); static void SyntheticMotion(int x, int y); static void PostNewCursor(void); @@ -284,8 +283,8 @@ XineramaSetCursorPosition( that screen are. */ pScreen = sprite.screen; - x += panoramiXdataPtr[0].x; - y += panoramiXdataPtr[0].y; + x += xineramaDataPtr[0].x; + y += xineramaDataPtr[0].y; if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], x, y, &box)) @@ -303,10 +302,10 @@ XineramaSetCursorPosition( } 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; + sprite.hotPhys.x = x - xineramaDataPtr[0].x; + sprite.hotPhys.y = y - xineramaDataPtr[0].y; + x -= xineramaDataPtr[pScreen->myNum].x; + y -= xineramaDataPtr[pScreen->myNum].y; return (*pScreen->SetCursorPosition)(pScreen, x, y, generateEvent); } @@ -320,14 +319,19 @@ XineramaConstrainCursor(void) /* 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; + newBox.x1 += xineramaDataPtr[0].x - xineramaDataPtr[pScreen->myNum].x; + newBox.x2 += xineramaDataPtr[0].x - xineramaDataPtr[pScreen->myNum].x; + newBox.y1 += xineramaDataPtr[0].y - xineramaDataPtr[pScreen->myNum].y; + newBox.y2 += xineramaDataPtr[0].y - xineramaDataPtr[pScreen->myNum].y; (* pScreen->ConstrainCursor)(pScreen, &newBox); } +#ifdef SHAPE +static void +ConfineToShape(RegionPtr, int *, int *); +#endif + static void XineramaCheckPhysLimits( CursorPtr cursor, @@ -375,17 +379,17 @@ XineramaSetWindowPntrs(WindowPtr pWin) { if(pWin == WindowTable[0]) { memcpy(sprite.windows, WindowTable, - PanoramiXNumScreens*sizeof(WindowPtr)); + XineramaNumScreens*sizeof(WindowPtr)); } else { - PanoramiXRes *win; + XineramaRes *win; int i; - win = (PanoramiXRes*)LookupIDByType(pWin->drawable.id, XRT_WINDOW); + win = (XineramaRes*)LookupIDByType(pWin->drawable.id, XRT_WINDOW); if(!win) return FALSE; - for(i = 0; i < PanoramiXNumScreens; i++) { + for(i = 0; i < XineramaNumScreens; i++) { sprite.windows[i] = LookupIDByType(win->info[i].id, RT_WINDOW); if(!sprite.windows[i]) /* window is being unmapped */ return FALSE; @@ -416,16 +420,16 @@ XineramaCheckVirtualMotion( if(!XineramaSetWindowPntrs(pWin)) return; - i = PanoramiXNumScreens - 1; + i = XineramaNumScreens - 1; REGION_COPY(sprite.screen, &sprite.Reg2, &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; + off_x = xineramaDataPtr[i].x; + off_y = xineramaDataPtr[i].y; while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; + x = off_x - xineramaDataPtr[i].x; + y = off_y - xineramaDataPtr[i].y; if(x || y) REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y); @@ -433,8 +437,8 @@ XineramaCheckVirtualMotion( REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2, &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; + off_x = xineramaDataPtr[i].x; + off_y = xineramaDataPtr[i].y; } lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2); @@ -471,10 +475,10 @@ XineramaCheckMotion(xEvent *xE) /* 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; + XE_KBPTR.rootX += xineramaDataPtr[sprite.screen->myNum].x - + xineramaDataPtr[0].x; + XE_KBPTR.rootY += xineramaDataPtr[sprite.screen->myNum].y - + xineramaDataPtr[0].y; sprite.hot.x = XE_KBPTR.rootX; sprite.hot.y = XE_KBPTR.rootY; @@ -533,16 +537,16 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) if(!XineramaSetWindowPntrs(pWin)) return; - i = PanoramiXNumScreens - 1; + i = XineramaNumScreens - 1; REGION_COPY(sprite.screen, &sprite.Reg1, &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; + off_x = xineramaDataPtr[i].x; + off_y = xineramaDataPtr[i].y; while(i--) { - x = off_x - panoramiXdataPtr[i].x; - y = off_y - panoramiXdataPtr[i].y; + x = off_x - xineramaDataPtr[i].x; + y = off_y - xineramaDataPtr[i].y; if(x || y) REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y); @@ -550,8 +554,8 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1, &sprite.windows[i]->borderSize); - off_x = panoramiXdataPtr[i].x; - off_y = panoramiXdataPtr[i].y; + off_x = xineramaDataPtr[i].x; + off_y = xineramaDataPtr[i].y; } sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1); @@ -583,7 +587,7 @@ XineramaChangeToCursor(CursorPtr cursor) } -#endif /* PANORAMIX */ +#endif /* XINERAMA */ void SetMaskForEvent(mask, event) @@ -609,13 +613,13 @@ SyntheticMotion(int x, int y) { xEvent xE; -#ifdef PANORAMIX +#ifdef XINERAMA /* 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; + if(!noXineramaExtension) { + x += xineramaDataPtr[0].x - xineramaDataPtr[sprite.screen->myNum].x; + y += xineramaDataPtr[0].y - xineramaDataPtr[sprite.screen->myNum].y; } #endif xE.u.keyButtonPointer.rootX = x; @@ -716,8 +720,9 @@ CheckVirtualMotion( register QdEventPtr qe, register WindowPtr pWin) { -#ifdef PANORAMIX - if(!noPanoramiXExtension) { + +#ifdef XINERAMA + if(!noXineramaExtension) { XineramaCheckVirtualMotion(qe, pWin); return; } @@ -767,8 +772,8 @@ ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen) { ScreenPtr pScreen = pWin->drawable.pScreen; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { +#ifdef XINERAMA + if(!noXineramaExtension) { XineramaConfineCursorToWindow(pWin, generateEvents); return; } @@ -800,8 +805,8 @@ PointerConfinedToScreen() static void ChangeToCursor(CursorPtr cursor) { -#ifdef PANORAMIX - if(!noPanoramiXExtension) { +#ifdef XINERAMA + if(!noXineramaExtension) { XineramaChangeToCursor(cursor); return; } @@ -885,17 +890,17 @@ GetSpritePosition(px, py) *py = sprite.hotPhys.y; } -#ifdef PANORAMIX +#ifdef XINERAMA int XineramaGetCursorScreen() { - if(!noPanoramiXExtension) { + if(!noXineramaExtension) { return sprite.screen->myNum; } else { return 0; } } -#endif /* PANORAMIX */ +#endif /* XINERAMA */ #define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ @@ -969,12 +974,12 @@ EnqueueEvent(xE, device, count) } if (xE->u.u.type == MotionNotify) { -#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; +#ifdef XINERAMA + if(!noXineramaExtension) { + XE_KBPTR.rootX += xineramaDataPtr[sprite.screen->myNum].x - + xineramaDataPtr[0].x; + XE_KBPTR.rootY += xineramaDataPtr[sprite.screen->myNum].y - + xineramaDataPtr[0].y; } #endif sprite.hotPhys.x = XE_KBPTR.rootX; @@ -1025,17 +1030,17 @@ PlayReleasedEvents(void) CheckVirtualMotion(qe, NullWindow); syncEvents.time.months = qe->months; syncEvents.time.milliseconds = qe->event->u.keyButtonPointer.time; -#ifdef PANORAMIX +#ifdef XINERAMA /* Translate back to the sprite screen since processInputProc will translate from sprite screen to screen 0 upon reentry to the DIX layer */ - if(!noPanoramiXExtension) { + if(!noXineramaExtension) { qe->event->u.keyButtonPointer.rootX += - panoramiXdataPtr[0].x - - panoramiXdataPtr[sprite.screen->myNum].x; + xineramaDataPtr[0].x - + xineramaDataPtr[sprite.screen->myNum].x; qe->event->u.keyButtonPointer.rootY += - panoramiXdataPtr[0].y - - panoramiXdataPtr[sprite.screen->myNum].y; + xineramaDataPtr[0].y - + xineramaDataPtr[sprite.screen->myNum].y; } #endif (*qe->device->public.processInputProc)(qe->event, qe->device, @@ -1664,7 +1669,7 @@ DeliverEventsToWindow(pWin, pEvents, count, filter, grab, mskidx) Only works for core events. */ -#ifdef PANORAMIX +#ifdef XINERAMA static int XineramaTryClientEventsResult( ClientPtr client, @@ -1697,8 +1702,8 @@ MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient) { if (wClient(pWin) == dontClient) return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) +#ifdef XINERAMA + if(!noXineramaExtension && pWin->drawable.pScreen->myNum) return XineramaTryClientEventsResult( wClient(pWin), NullGrab, pWin->eventMask, filter); #endif @@ -1711,8 +1716,8 @@ MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient) { if (SameClient(other, dontClient)) return 0; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) +#ifdef XINERAMA + if(!noXineramaExtension && pWin->drawable.pScreen->myNum) return XineramaTryClientEventsResult( rClient(other), NullGrab, other->mask, filter); #endif @@ -1854,8 +1859,8 @@ DeliverEvents(pWin, xE, count, otherParent) Mask filter; int deliveries; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) +#ifdef XINERAMA + if(!noXineramaExtension && pWin->drawable.pScreen->myNum) return count; #endif @@ -1885,7 +1890,7 @@ DeliverEvents(pWin, xE, count, otherParent) return deliveries; } - +#ifndef NO_XINERAMA_PORT static Bool PointInBorderSize(WindowPtr pWin, int x, int y) { @@ -1894,15 +1899,15 @@ PointInBorderSize(WindowPtr pWin, int x, int y) if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box)) return TRUE; -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { +#ifdef XINERAMA + if(!noXineramaExtension && XineramaSetWindowPntrs(pWin)) { int i; - for(i = 1; i < PanoramiXNumScreens; i++) { + for(i = 1; i < XineramaNumScreens; 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, + x + xineramaDataPtr[0].x - xineramaDataPtr[i].x, + y + xineramaDataPtr[0].y - xineramaDataPtr[i].y, &box)) return TRUE; } @@ -1910,6 +1915,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) #endif return FALSE; } +#endif /* NO_XINERAMA_PORT */ static WindowPtr XYToWindow(int x, int y) @@ -1932,7 +1938,13 @@ XYToWindow(int x, int y) * is made to see if the point is inside * borderSize */ +#ifndef NO_XINERAMA_PORT && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) +#else + && (!wBoundingShape(pWin) || + POINT_IN_REGION(pWin->drawable.pScreen, + &pWin->borderSize, x, y, &box)) +#endif #endif ) { @@ -1958,8 +1970,8 @@ CheckMotion(xEvent *xE) { WindowPtr prevSpriteWin = sprite.win; -#ifdef PANORAMIX - if(!noPanoramiXExtension) +#ifdef XINERAMA + if(!noXineramaExtension) return XineramaCheckMotion(xE); #endif @@ -2047,12 +2059,12 @@ DefineInitialRootWindow(win) (*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; +#ifdef XINERAMA + if(!noXineramaExtension) { + sprite.hotLimits.x1 = -xineramaDataPtr[0].x; + sprite.hotLimits.y1 = -xineramaDataPtr[0].y; + sprite.hotLimits.x2 = XineramaPixWidth - xineramaDataPtr[0].x; + sprite.hotLimits.y2 = XineramaPixHeight - xineramaDataPtr[0].y; sprite.physLimits = sprite.hotLimits; sprite.confineWin = NullWindow; #ifdef SHAPE @@ -2088,12 +2100,12 @@ 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; +#ifdef XINERAMA + if(!noXineramaExtension) { + sprite.hotPhys.x += xineramaDataPtr[newScreen->myNum].x - + xineramaDataPtr[0].x; + sprite.hotPhys.y += xineramaDataPtr[newScreen->myNum].y - + xineramaDataPtr[0].y; if (newScreen != sprite.screen) { sprite.screen = newScreen; /* Make sure we tell the DDX to update its copy of the screen */ @@ -2105,10 +2117,10 @@ NewCurrentScreen(newScreen, x, y) 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); + sprite.hotPhys.x + xineramaDataPtr[0].x - + xineramaDataPtr[sprite.screen->myNum].x, + sprite.hotPhys.y + xineramaDataPtr[0].y - + xineramaDataPtr[sprite.screen->myNum].y, FALSE); } } else #endif @@ -2116,7 +2128,7 @@ NewCurrentScreen(newScreen, x, y) ConfineCursorToWindow(WindowTable[newScreen->myNum], TRUE, FALSE); } -#ifdef PANORAMIX +#ifdef XINERAMA static Bool XineramaPointInWindowIsVisible( @@ -2136,14 +2148,14 @@ XineramaPointInWindowIsVisible( if(!XineramaSetWindowPntrs(pWin)) return FALSE; - xoff = x + panoramiXdataPtr[0].x; - yoff = y + panoramiXdataPtr[0].y; + xoff = x + xineramaDataPtr[0].x; + yoff = y + xineramaDataPtr[0].y; - for(i = 1; i < PanoramiXNumScreens; i++) { + for(i = 1; i < XineramaNumScreens; i++) { pWin = sprite.windows[i]; pScreen = pWin->drawable.pScreen; - x = xoff - panoramiXdataPtr[i].x; - y = yoff - panoramiXdataPtr[i].y; + x = xoff - xineramaDataPtr[i].x; + y = yoff - xineramaDataPtr[i].y; if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) return TRUE; @@ -2183,8 +2195,8 @@ XineramaWarpPointer(ClientPtr client) winX = source->drawable.x; winY = source->drawable.y; if(source == WindowTable[0]) { - winX -= panoramiXdataPtr[0].x; - winY -= panoramiXdataPtr[0].y; + winX -= xineramaDataPtr[0].x; + winY -= xineramaDataPtr[0].y; } if (x < winX + stuff->srcX || y < winY + stuff->srcY || @@ -2199,8 +2211,8 @@ XineramaWarpPointer(ClientPtr client) x = dest->drawable.x; y = dest->drawable.y; if(dest == WindowTable[0]) { - x -= panoramiXdataPtr[0].x; - y -= panoramiXdataPtr[0].y; + x -= xineramaDataPtr[0].x; + y -= xineramaDataPtr[0].y; } } @@ -2223,7 +2235,7 @@ XineramaWarpPointer(ClientPtr client) return Success; } -#endif +#endif /* XINERAMA */ int @@ -2238,8 +2250,8 @@ ProcWarpPointer(client) REQUEST_SIZE_MATCH(xWarpPointerReq); -#ifdef PANORAMIX - if(!noPanoramiXExtension) +#ifdef XINERAMA + if(!noXineramaExtension) return XineramaWarpPointer(client); #endif @@ -2316,17 +2328,18 @@ ProcWarpPointer(client) return Success; } +#ifndef NO_XINERAMA_PORT static Bool BorderSizeNotEmpty(WindowPtr pWin) { if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize)) return TRUE; -#ifdef PANORAMIX - if(!noPanoramiXExtension && XineramaSetWindowPntrs(pWin)) { +#ifdef XINERAMA + if(!noXineramaExtension && XineramaSetWindowPntrs(pWin)) { int i; - for(i = 1; i < PanoramiXNumScreens; i++) { + for(i = 1; i < XineramaNumScreens; i++) { if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize)) return TRUE; } @@ -2334,6 +2347,7 @@ BorderSizeNotEmpty(WindowPtr pWin) #endif return FALSE; } +#endif /* NO_XINERAMA_PORT */ /* "CheckPassiveGrabsOnWindow" checks to see if the event passed in causes a passive grab set on the window to be activated. */ @@ -2389,7 +2403,12 @@ CheckPassiveGrabsOnWindow( if (GrabMatchesSecond(&tempGrab, grab) && (!grab->confineTo || (grab->confineTo->realized && - BorderSizeNotEmpty(grab->confineTo)))) +#ifndef NO_XINERAMA_PORT + BorderSizeNotEmpty(grab->confineTo)))) +#else + REGION_NOTEMPTY( grab->confineTo->drawable.pScreen, + &grab->confineTo->borderSize)))) +#endif { #ifdef XCSECURITY if (!SecurityCheckDeviceAccess(wClient(pWin), device, FALSE)) @@ -3331,8 +3350,8 @@ DoFocusEvents(dev, fromWin, toWin, mode) FocusOutEvents(dev, sprite.win, ROOT, mode, NotifyPointer, TRUE); /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) +#ifdef XINERAMA + if ( !noXineramaExtension ) FocusEvent(dev, FocusOut, mode, out, WindowTable[0]); else #endif @@ -3350,8 +3369,8 @@ DoFocusEvents(dev, fromWin, toWin, mode) NotifyNonlinearVirtual, FALSE); } /* Notify all the roots */ -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) +#ifdef XINERAMA + if ( !noXineramaExtension ) FocusEvent(dev, FocusIn, mode, in, WindowTable[0]); else #endif @@ -3368,8 +3387,8 @@ DoFocusEvents(dev, fromWin, toWin, mode) if (fromWin == PointerRootWin) FocusOutEvents(dev, sprite.win, ROOT, mode, NotifyPointer, TRUE); -#ifdef PANORAMIX - if ( !noPanoramiXExtension ) +#ifdef XINERAMA + if ( !noXineramaExtension ) FocusEvent(dev, FocusOut, mode, out, WindowTable[0]); else #endif @@ -3882,13 +3901,13 @@ ProcQueryPointer(client) rep.winY = 0; } -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - rep.rootX += panoramiXdataPtr[0].x; - rep.rootY += panoramiXdataPtr[0].y; +#ifdef XINERAMA + if(!noXineramaExtension) { + rep.rootX += xineramaDataPtr[0].x; + rep.rootY += xineramaDataPtr[0].y; if(stuff->id == rep.root) { - rep.winX += panoramiXdataPtr[0].x; - rep.winY += panoramiXdataPtr[0].y; + rep.winX += xineramaDataPtr[0].x; + rep.winY += xineramaDataPtr[0].y; } } #endif @@ -4350,8 +4369,8 @@ CheckCursorConfinement(pWin) GrabPtr grab = inputInfo.pointer->grab; WindowPtr confineTo; -#ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) return; +#ifdef XINERAMA + if(!noXineramaExtension && pWin->drawable.pScreen->myNum) return; #endif if (grab && (confineTo = grab->confineTo)) @@ -4410,8 +4429,8 @@ ProcRecolorCursor(client) for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { pscr = screenInfo.screens[nscr]; -#ifdef PANORAMIX - if(!noPanoramiXExtension) +#ifdef XINERAMA + if(!noXineramaExtension) displayed = (pscr == sprite.screen); else #endif @@ -4428,7 +4447,7 @@ WriteEventsToClient(pClient, count, events) int count; xEvent *events; { -#ifdef PANORAMIX +#ifdef XINERAMA xEvent eventCopy; #endif xEvent eventTo, *eventFrom; @@ -4439,9 +4458,9 @@ WriteEventsToClient(pClient, count, events) return; #endif -#ifdef PANORAMIX - if(!noPanoramiXExtension && - (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y)) +#ifdef XINERAMA + if(!noXineramaExtension && + (xineramaDataPtr[0].x || xineramaDataPtr[0].y)) { switch(events->u.u.type) { case MotionNotify: @@ -4458,13 +4477,13 @@ WriteEventsToClient(pClient, count, events) */ count = 1; /* should always be 1 */ memcpy(&eventCopy, events, sizeof(xEvent)); - eventCopy.u.keyButtonPointer.rootX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.rootY += panoramiXdataPtr[0].y; + eventCopy.u.keyButtonPointer.rootX += xineramaDataPtr[0].x; + eventCopy.u.keyButtonPointer.rootY += xineramaDataPtr[0].y; if(eventCopy.u.keyButtonPointer.event == eventCopy.u.keyButtonPointer.root) { - eventCopy.u.keyButtonPointer.eventX += panoramiXdataPtr[0].x; - eventCopy.u.keyButtonPointer.eventY += panoramiXdataPtr[0].y; + eventCopy.u.keyButtonPointer.eventX += xineramaDataPtr[0].x; + eventCopy.u.keyButtonPointer.eventY += xineramaDataPtr[0].y; } events = &eventCopy; break; diff --git a/dix/main.c b/dix/main.c index 37add2a62..3c2d1634e 100644 --- a/dix/main.c +++ b/dix/main.c @@ -1,3 +1,4 @@ +/* $XdotOrg: xc/programs/Xserver/dix/main.c,v 3.44 2003/11/17 22:20:34 dawes Exp $ */ /* $XFree86: xc/programs/Xserver/dix/main.c,v 3.44 2003/11/17 22:20:34 dawes Exp $ */ /*********************************************************** @@ -47,7 +48,7 @@ SOFTWARE. ******************************************************************/ /* $Xorg: main.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ -/* The panoramix components contained the following notice */ +/* The Xinerama components contained the following notice */ /**************************************************************** * * * Copyright (c) Digital Equipment Corporation, 1991, 1997 * @@ -92,8 +93,8 @@ SOFTWARE. #include "site.h" #include "dixfont.h" #include "extnsionst.h" -#ifdef PANORAMIX -#include "panoramiXsrv.h" +#ifdef XINERAMA +extern Bool noXineramaExtension; #else #include "dixevents.h" /* InitEvents() */ #include "dispatch.h" /* InitProcVectors() */ @@ -122,7 +123,7 @@ extern int screenPrivateCount; extern void InitProcVectors(void); extern Bool CreateGCperDepthArray(void); -#ifndef PANORAMIX +#ifndef XINERAMA static #endif Bool CreateConnectionBlock(void); @@ -402,12 +403,12 @@ main(int argc, char *argv[], char *envp[]) DPMSEnabled = FALSE; #endif -#ifdef PANORAMIX +#ifdef XINERAMA /* * Consolidate window and colourmap information for each screen */ - if (!noPanoramiXExtension) - PanoramiXConsolidate(); + if (!noXineramaExtension) + XineramaConsolidate(); #endif for (i = 0; i < screenInfo.numScreens; i++) @@ -418,9 +419,9 @@ main(int argc, char *argv[], char *envp[]) SetDPMSTimers(); #endif -#ifdef PANORAMIX - if (!noPanoramiXExtension) { - if (!PanoramiXCreateConnectionBlock()) +#ifdef XINERAMA + if (!noXineramaExtension) { + if (!XineramaCreateConnectionBlock()) FatalError("could not create connection block info"); } else #endif @@ -437,12 +438,12 @@ main(int argc, char *argv[], char *envp[]) FreeScreenSaverTimer(); CloseDownExtensions(); -#ifdef PANORAMIX +#ifdef XINERAMA { - Bool remember_it = noPanoramiXExtension; - noPanoramiXExtension = TRUE; + Bool remember_it = noXineramaExtension; + noXineramaExtension = TRUE; FreeAllResources(); - noPanoramiXExtension = remember_it; + noXineramaExtension = remember_it; } #else FreeAllResources(); @@ -492,7 +493,7 @@ main(int argc, char *argv[], char *envp[]) static int padlength[4] = {0, 3, 2, 1}; -#ifndef PANORAMIX +#ifndef XINERAMA static #endif Bool diff --git a/dix/resource.c b/dix/resource.c index d885c03ef..ddcb8d0a3 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -1,3 +1,4 @@ +/* $XdotOrg$ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -88,9 +89,9 @@ SOFTWARE. #include "dixevents.h" #include "dixgrabs.h" #include "cursor.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" +#ifdef XINERAMA +#include "xinerama.h" +#include "xineramaSrv.h" #endif #include <assert.h> @@ -672,7 +673,7 @@ FindAllClientResources( } } - +#ifndef NO_XINERAMA_PORT pointer LookupClientResourceComplex( ClientPtr client, @@ -698,7 +699,7 @@ LookupClientResourceComplex( } return NULL; } - +#endif /* NO_XINERAMA_PORT */ void FreeClientNeverRetainResources(ClientPtr client) @@ -797,17 +798,17 @@ LegalNewID(id, client) register ClientPtr client; { -#ifdef PANORAMIX +#ifdef XINERAMA XID minid, maxid; - if (!noPanoramiXExtension) { + if (!noXineramaExtension) { minid = client->clientAsMask | (client->index ? SERVER_BIT : SERVER_MINID); maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; if ((id >= minid) && (id <= maxid)) return TRUE; } -#endif /* PANORAMIX */ +#endif /* XINERAMA */ return ((client->clientAsMask == (id & ~RESOURCE_ID_MASK)) && ((clientTable[client->index].expectID <= id) || !LookupIDByClass(id, RC_ANY))); diff --git a/dix/window.c b/dix/window.c index 0ed9cb083..20dbc83df 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1,3 +1,4 @@ +/* $XdotOrg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* @@ -48,7 +49,7 @@ SOFTWARE. */ -/* The panoramix components contained the following notice */ +/* The Xinerama components contained the following notice */ /**************************************************************** * * * Copyright (c) Digital Equipment Corporation, 1991, 1997 * @@ -85,9 +86,9 @@ SOFTWARE. #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" +#ifdef XINERAMA +#include "xinerama.h" +#include "xineramaSrv.h" #endif #include "dixevents.h" #include "globals.h" @@ -2320,10 +2321,10 @@ ConfigureWindow(pWin, mask, vlist, client) event.u.u.detail = Above; event.u.configureRequest.x = x; event.u.configureRequest.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureRequest.x += panoramiXdataPtr[0].x; - event.u.configureRequest.y += panoramiXdataPtr[0].y; +#ifdef XINERAMA + if(!noXineramaExtension && (!pParent || !pParent->parent)) { + event.u.configureRequest.x += xineramaDataPtr[0].x; + event.u.configureRequest.y += xineramaDataPtr[0].y; } #endif event.u.configureRequest.width = w; @@ -2406,10 +2407,10 @@ ActuallyDoSomething: event.u.configureNotify.aboveSibling = None; event.u.configureNotify.x = x; event.u.configureNotify.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && (!pParent || !pParent->parent)) { - event.u.configureNotify.x += panoramiXdataPtr[0].x; - event.u.configureNotify.y += panoramiXdataPtr[0].y; +#ifdef XINERAMA + if(!noXineramaExtension && (!pParent || !pParent->parent)) { + event.u.configureNotify.x += xineramaDataPtr[0].x; + event.u.configureNotify.y += xineramaDataPtr[0].y; } #endif event.u.configureNotify.width = w; @@ -2564,10 +2565,10 @@ ReparentWindow(pWin, pParent, x, y, client) event.u.reparent.parent = pParent->drawable.id; event.u.reparent.x = x; event.u.reparent.y = y; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pParent->parent) { - event.u.reparent.x += panoramiXdataPtr[0].x; - event.u.reparent.y += panoramiXdataPtr[0].y; +#ifdef XINERAMA + if(!noXineramaExtension && !pParent->parent) { + event.u.reparent.x += xineramaDataPtr[0].x; + event.u.reparent.y += xineramaDataPtr[0].y; } #endif event.u.reparent.override = pWin->overrideRedirect; @@ -2937,10 +2938,10 @@ UnrealizeTree( { pChild->realized = FALSE; pChild->visibility = VisibilityNotViewable; -#ifdef PANORAMIX - if(!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) { - PanoramiXRes *win; - win = (PanoramiXRes*)LookupIDByType(pChild->drawable.id, +#ifdef XINERAMA + if(!noXineramaExtension && !pChild->drawable.pScreen->myNum) { + XineramaRes *win; + win = (XineramaRes*)LookupIDByType(pChild->drawable.id, XRT_WINDOW); if(win) win->u.win.visibility = VisibilityNotViewable; @@ -3219,25 +3220,26 @@ SendVisibilityNotify(pWin) WindowPtr pWin; { xEvent event; +#ifndef NO_XINERAMA_PORT unsigned int visibility = pWin->visibility; - -#ifdef PANORAMIX +#endif +#ifdef XINERAMA /* This is not quite correct yet, but it's close */ - if(!noPanoramiXExtension) { - PanoramiXRes *win; + if(!noXineramaExtension) { + XineramaRes *win; WindowPtr pWin2; int i, Scrnum; Scrnum = pWin->drawable.pScreen->myNum; - win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum); + win = XineramaFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, Scrnum); if(!win || (win->u.win.visibility == visibility)) return; switch(visibility) { case VisibilityUnobscured: - for(i = 0; i < PanoramiXNumScreens; i++) { + for(i = 0; i < XineramaNumScreens; i++) { if(i == Scrnum) continue; pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); @@ -3257,7 +3259,7 @@ SendVisibilityNotify(pWin) } break; case VisibilityFullyObscured: - for(i = 0; i < PanoramiXNumScreens; i++) { + for(i = 0; i < XineramaNumScreens; i++) { if(i == Scrnum) continue; pWin2 = (WindowPtr)LookupIDByType(win->info[i].id, RT_WINDOW); @@ -3275,7 +3277,6 @@ SendVisibilityNotify(pWin) win->u.win.visibility = visibility; } #endif - event.u.u.type = VisibilityNotify; event.u.visibility.window = pWin->drawable.id; event.u.visibility.state = visibility; |