VirtualBox

Changeset 35633 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 19, 2011 4:02:24 PM (14 years ago)
Author:
vboxsync
Message:

Main/Display: multimonitor enable/disable screen fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r35612 r35633  
    763763        }
    764764
     765        /* @todo Merge these two 'if's within one 'if (!pFBInfo->pFramebuffer.isNull())' */
    765766        if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN && !pFBInfo->pFramebuffer.isNull())
    766767        {
     
    774775            pFBInfo->fDefaultFormat = (usesGuestVRAM == FALSE);
    775776
     777            /* If the primary framebuffer is disabled, tell the VGA device to not to copy
     778             * pixels from VRAM to the framebuffer.
     779             */
    776780            if (pFBInfo->fDisabled)
    777781                mpDrv->pUpPort->pfnSetRenderVRAM (mpDrv->pUpPort, false);
     
    779783                mpDrv->pUpPort->pfnSetRenderVRAM (mpDrv->pUpPort,
    780784                                                  pFBInfo->fDefaultFormat);
     785
     786            /* If the screen resize was because of disabling, tell framebuffer to repaint.
     787             * The framebuffer if now in default format so it will not use guest VRAM
     788             * and will show usually black image which is there after framebuffer resize.
     789             */
     790            if (pFBInfo->fDisabled)
     791                pFBInfo->pFramebuffer->NotifyUpdate(0, 0, mpDrv->IConnector.cx, mpDrv->IConnector.cy);
    781792        }
    782793        else if (!pFBInfo->pFramebuffer.isNull())
     
    786797
    787798            pFBInfo->fDefaultFormat = (usesGuestVRAM == FALSE);
     799
     800            /* If the screen resize was because of disabling, tell framebuffer to repaint.
     801             * The framebuffer if now in default format so it will not use guest VRAM
     802             * and will show usually black image which is there after framebuffer resize.
     803             */
     804            if (pFBInfo->fDisabled)
     805                pFBInfo->pFramebuffer->NotifyUpdate(0, 0, pFBInfo->w, pFBInfo->h);
    788806        }
    789807        LogFlow(("[%d]: default format %d\n", uScreenId, pFBInfo->fDefaultFormat));
     
    30443062                continue;
    30453063            }
    3046             /* Continue with normal processing because the status here is ResizeStatus_Void. */
    3047             if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
    3048             {
    3049                 /* Repaint the display because VM continued to run during the framebuffer resize. */
    3050                 if (!pFBInfo->pFramebuffer.isNull())
    3051                 {
    3052                     pDisplay->vbvaLock();
    3053                     pDrv->pUpPort->pfnUpdateDisplayAll(pDrv->pUpPort);
    3054                     pDisplay->vbvaUnlock();
    3055                 }
    3056             }
     3064            /* Continue with normal processing because the status here is ResizeStatus_Void.
     3065             * Repaint all displays because VM continued to run during the framebuffer resize.
     3066             */
     3067            pDisplay->InvalidateAndUpdateEMT(pDisplay);
    30573068        }
    30583069        else if (u32ResizeStatus == ResizeStatus_InProgress)
     
    37383749    }
    37393750
     3751    bool fResize = pFBInfo->fDisabled; /* If display was disabled, do a resize, because the framebuffer was changed. */
     3752
    37403753    if (pFBInfo->fDisabled)
    37413754    {
     
    37573770     * The guest uses this VBVAResize call for both.
    37583771     */
    3759     bool fResize =    pFBInfo->u16BitsPerPixel != pScreen->u16BitsPerPixel
    3760                    || pFBInfo->pu8FramebufferVRAM != (uint8_t *)pvVRAM + pScreen->u32StartOffset
    3761                    || pFBInfo->u32LineSize != pScreen->u32LineSize
    3762                    || pFBInfo->w != pScreen->u32Width
    3763                    || pFBInfo->h != pScreen->u32Height;
     3772    fResize =    fResize
     3773              || pFBInfo->u16BitsPerPixel != pScreen->u16BitsPerPixel
     3774              || pFBInfo->pu8FramebufferVRAM != (uint8_t *)pvVRAM + pScreen->u32StartOffset
     3775              || pFBInfo->u32LineSize != pScreen->u32LineSize
     3776              || pFBInfo->w != pScreen->u32Width
     3777              || pFBInfo->h != pScreen->u32Height;
    37643778
    37653779    bool fNewOrigin =    pFBInfo->xOrigin != pScreen->i32OriginX
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette