(!1989) panoramix: replace FOR_NSCREENS() by FOR_NSCREENS_BACKWARD(i)
FOR_NSCREENS() is just alias for FOR_NSCREENS_BACKWARD(). In many cases it really matters that we're going backwards and the last iteration visited the screen #0, and that one is panoramix-wrapped. Thus directly calling FOR_NSCREENS_BACKWARD() here and dropping the alias. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									ad8e4dcbe3
								
							
						
					
					
						commit
						3f175efe19
					
				| 
						 | 
				
			
			@ -384,7 +384,7 @@ XineramaInitData(void)
 | 
			
		|||
    int i, w, h;
 | 
			
		||||
 | 
			
		||||
    RegionNull(&PanoramiXScreenRegion);
 | 
			
		||||
    FOR_NSCREENS(i) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
        BoxRec TheBox;
 | 
			
		||||
        RegionRec ScreenRegion;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -474,7 +474,7 @@ PanoramiXExtensionInit(void)
 | 
			
		|||
         *      run in non-PanoramiXeen mode.
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        FOR_NSCREENS(i) {
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
            pScreen = screenInfo.screens[i];
 | 
			
		||||
            pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
 | 
			
		||||
            dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
 | 
			
		||||
| 
						 | 
				
			
			@ -827,7 +827,7 @@ PanoramiXConsolidate(void)
 | 
			
		|||
    saver = malloc(sizeof(PanoramiXRes));
 | 
			
		||||
    saver->type = XRT_WINDOW;
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(i) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
        ScreenPtr scr = screenInfo.screens[i];
 | 
			
		||||
 | 
			
		||||
        root->info[i].id = scr->root->drawable.id;
 | 
			
		||||
| 
						 | 
				
			
			@ -1072,7 +1072,7 @@ ProcXineramaQueryScreens(ClientPtr client)
 | 
			
		|||
        xXineramaScreenInfo scratch;
 | 
			
		||||
        int i;
 | 
			
		||||
 | 
			
		||||
        FOR_NSCREENS(i) {
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
            scratch.x_org = screenInfo.screens[i]->x;
 | 
			
		||||
            scratch.y_org = screenInfo.screens[i]->y;
 | 
			
		||||
            scratch.width = screenInfo.screens[i]->width;
 | 
			
		||||
| 
						 | 
				
			
			@ -1171,7 +1171,7 @@ XineramaGetImageData(DrawablePtr *pDrawables,
 | 
			
		|||
 | 
			
		||||
    depth = (format == XYPixmap) ? 1 : pDraw->depth;
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(i) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
        BoxRec TheBox;
 | 
			
		||||
        ScreenPtr pScreen;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,7 +70,6 @@ typedef struct {
 | 
			
		|||
#define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++)
 | 
			
		||||
#define FOR_NSCREENS_FORWARD_SKIP(j) for(j = 1; j < PanoramiXNumScreens; j++)
 | 
			
		||||
#define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
 | 
			
		||||
#define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j)
 | 
			
		||||
 | 
			
		||||
#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -917,7 +917,7 @@ PanoramiXCopyGC(ClientPtr client)
 | 
			
		|||
    if (result != Success)
 | 
			
		||||
        return result;
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(j) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
        stuff->srcGC = srcGC->info[j].id;
 | 
			
		||||
        stuff->dstGC = dstGC->info[j].id;
 | 
			
		||||
        result = (*SavedProcVector[X_CopyGC]) (client);
 | 
			
		||||
| 
						 | 
				
			
			@ -1102,7 +1102,7 @@ PanoramiXCopyArea(ClientPtr client)
 | 
			
		|||
        char *data;
 | 
			
		||||
        int pitch, rc;
 | 
			
		||||
 | 
			
		||||
        FOR_NSCREENS(j) {
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
            rc = dixLookupDrawable(drawables + j, src->info[j].id, client, 0,
 | 
			
		||||
                                   DixGetAttrAccess);
 | 
			
		||||
            if (rc != Success)
 | 
			
		||||
| 
						 | 
				
			
			@ -1156,7 +1156,7 @@ PanoramiXCopyArea(ClientPtr client)
 | 
			
		|||
            RegionInit(&rgn, &sourceBox, 1);
 | 
			
		||||
 | 
			
		||||
            /* subtract the (screen-space) clips of the source drawables */
 | 
			
		||||
            FOR_NSCREENS(j) {
 | 
			
		||||
            FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
                ScreenPtr screen = screenInfo.screens[j];
 | 
			
		||||
                RegionPtr sd;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -309,7 +309,7 @@ ProcShapeRectangles(ClientPtr client)
 | 
			
		|||
    if (result != Success)
 | 
			
		||||
        return result;
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(j) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
        stuff->dest = win->info[j].id;
 | 
			
		||||
        result = ShapeRectangles(client, stuff);
 | 
			
		||||
        if (result != Success)
 | 
			
		||||
| 
						 | 
				
			
			@ -414,7 +414,7 @@ ProcShapeMask(ClientPtr client)
 | 
			
		|||
    else
 | 
			
		||||
        pmap = NULL;
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(j) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
        stuff->dest = win->info[j].id;
 | 
			
		||||
        if (pmap)
 | 
			
		||||
            stuff->src = pmap->info[j].id;
 | 
			
		||||
| 
						 | 
				
			
			@ -536,7 +536,7 @@ ProcShapeCombine(ClientPtr client)
 | 
			
		|||
    if (result != Success)
 | 
			
		||||
        return result;
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(j) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
        stuff->dest = win->info[j].id;
 | 
			
		||||
        stuff->src = win2->info[j].id;
 | 
			
		||||
        result = ShapeCombine(client, stuff);
 | 
			
		||||
| 
						 | 
				
			
			@ -600,7 +600,7 @@ ProcShapeOffset(ClientPtr client)
 | 
			
		|||
    if (result != Success)
 | 
			
		||||
        return result;
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(j) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
        stuff->dest = win->info[j].id;
 | 
			
		||||
        result = ShapeOffset(client, stuff);
 | 
			
		||||
        if (result != Success)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -761,7 +761,7 @@ ProcPanoramiXShmPutImage(ClientPtr client)
 | 
			
		|||
    orig_y = stuff->dstY;
 | 
			
		||||
    sendEvent = stuff->sendEvent;
 | 
			
		||||
    stuff->sendEvent = 0;
 | 
			
		||||
    FOR_NSCREENS(j) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
        if (!j)
 | 
			
		||||
            stuff->sendEvent = sendEvent;
 | 
			
		||||
        stuff->drawable = draw->info[j].id;
 | 
			
		||||
| 
						 | 
				
			
			@ -985,7 +985,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
 | 
			
		|||
 | 
			
		||||
    result = Success;
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(j) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(j) {
 | 
			
		||||
        ShmScrPrivateRec *screen_priv;
 | 
			
		||||
 | 
			
		||||
        pScreen = screenInfo.screens[j];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1750,7 +1750,7 @@ XineramifyXv(void)
 | 
			
		|||
            if (!port)
 | 
			
		||||
                break;
 | 
			
		||||
 | 
			
		||||
            FOR_NSCREENS(k) {
 | 
			
		||||
            FOR_NSCREENS_BACKWARD(k) {
 | 
			
		||||
                if (MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j))
 | 
			
		||||
                    port->info[k].id = MatchingAdaptors[k]->base_id + j;
 | 
			
		||||
                else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -707,7 +707,7 @@ PanoramiXCompositeNameWindowPixmap(ClientPtr client)
 | 
			
		|||
    newPix->u.pix.shared = FALSE;
 | 
			
		||||
    panoramix_setup_ids(newPix, client, stuff->pixmap);
 | 
			
		||||
 | 
			
		||||
    FOR_NSCREENS(i) {
 | 
			
		||||
    FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
        rc = dixLookupResourceByType((void **) &pWin, win->info[i].id,
 | 
			
		||||
                                     X11_RESTYPE_WINDOW, client,
 | 
			
		||||
                                     DixGetAttrAccess);
 | 
			
		||||
| 
						 | 
				
			
			@ -820,7 +820,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    if (overlayWin) {
 | 
			
		||||
        FOR_NSCREENS(i) {
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
            cs = GetCompScreen(screenInfo.screens[i]);
 | 
			
		||||
            overlayWin->info[i].id = cs->pOverlayWin->drawable.id;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -542,7 +542,7 @@ XineramaSetCursorPosition(DeviceIntPtr pDev, int x, int y, Bool generateEvent)
 | 
			
		|||
    y += screenInfo.screens[0]->y;
 | 
			
		||||
 | 
			
		||||
    if (!point_on_screen(pScreen, x, y)) {
 | 
			
		||||
        FOR_NSCREENS(i) {
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
            if (i == pScreen->myNum)
 | 
			
		||||
                continue;
 | 
			
		||||
            if (point_on_screen(screenInfo.screens[i], x, y)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -589,7 +589,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin)
 | 
			
		|||
    if (pWin == screenInfo.screens[0]->root) {
 | 
			
		||||
        int i;
 | 
			
		||||
 | 
			
		||||
        FOR_NSCREENS(i)
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(i)
 | 
			
		||||
            pSprite->windows[i] = screenInfo.screens[i]->root;
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
| 
						 | 
				
			
			@ -601,7 +601,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin)
 | 
			
		|||
        if (rc != Success)
 | 
			
		||||
            return FALSE;
 | 
			
		||||
 | 
			
		||||
        FOR_NSCREENS(i) {
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
            rc = dixLookupWindow(pSprite->windows + i, win->info[i].id,
 | 
			
		||||
                                 serverClient, DixReadAccess);
 | 
			
		||||
            if (rc != Success)  /* window is being unmapped */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3038,7 +3038,7 @@ SendVisibilityNotify(WindowPtr pWin)
 | 
			
		|||
 | 
			
		||||
        switch (visibility) {
 | 
			
		||||
        case VisibilityUnobscured:
 | 
			
		||||
        FOR_NSCREENS(i) {
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
            if (i == Scrnum)
 | 
			
		||||
                continue;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3063,7 +3063,7 @@ SendVisibilityNotify(WindowPtr pWin)
 | 
			
		|||
            }
 | 
			
		||||
            break;
 | 
			
		||||
        case VisibilityFullyObscured:
 | 
			
		||||
        FOR_NSCREENS(i) {
 | 
			
		||||
        FOR_NSCREENS_BACKWARD(i) {
 | 
			
		||||
            if (i == Scrnum)
 | 
			
		||||
                continue;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue