VirtualBox

Changeset 50828 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 20, 2014 9:29:56 AM (11 years ago)
Author:
vboxsync
Message:

DisplayImpl: repaint display after a resize (better fix for a race)

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r50754 r50828  
    355355    void vbvaReleaseCmd(VBVACMDHDR *pHdr, int32_t cbCmd);
    356356
    357     void handleResizeCompletedEMT(void);
     357    void handleResizeCompletedEMT(unsigned uScreenId);
    358358
    359359    RTCRITSECT mVBVALock;
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r50805 r50828  
    980980
    981981    /* The method also unlocks the framebuffer. */
    982     handleResizeCompletedEMT();
     982    handleResizeCompletedEMT(uScreenId);
    983983
    984984    return VINF_SUCCESS;
     
    991991 *  @thread EMT
    992992 */
    993 void Display::handleResizeCompletedEMT (void)
     993void Display::handleResizeCompletedEMT(unsigned uScreenId)
    994994{
    995995    LogRelFlowFunc(("\n"));
    996996
    997     unsigned uScreenId;
    998     for (uScreenId = 0; uScreenId < mcMonitors; uScreenId++)
    999     {
     997    do /* to use 'break' */
     998    {
     999        if (uScreenId >= mcMonitors)
     1000        {
     1001            break;
     1002        }
     1003
    10001004        DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];
    10011005
     
    10061010        {
    10071011            /* This is not the display that has completed resizing. */
    1008             continue;
     1012            AssertFailed();
     1013            break;
    10091014        }
    10101015
     
    10211026            handleDisplayResize (uScreenId, pFBInfo->pendingResize.bpp, pFBInfo->pendingResize.pvVRAM,
    10221027                                 pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h, pFBInfo->pendingResize.flags);
    1023             continue;
     1028            break;
    10241029        }
    10251030
     
    10731078        }
    10741079        LogRelFlow(("[%d]: default format %d\n", uScreenId, pFBInfo->fDefaultFormat));
    1075 
    1076         /* Repaint the display because VM continued to run during the framebuffer resize. */
    1077         InvalidateAndUpdateEMT(this, uScreenId, false);
    10781080
    10791081        /* Handle the case if there are some saved visible region that needs to be
     
    11311133        }
    11321134#endif /* VBOX_WITH_CROGL */
    1133     }
     1135    } while(0);
    11341136}
    11351137
     
    38393841            fNoUpdate = true; /* Always set it here, because pfnUpdateDisplayAll can cause a new resize. */
    38403842            /* The framebuffer was resized and display data need to be updated. */
    3841             pDisplay->handleResizeCompletedEMT ();
     3843            pDisplay->handleResizeCompletedEMT(uScreenId);
    38423844            if (pFBInfo->u32ResizeStatus != ResizeStatus_Void)
    38433845            {
     
    38453847                continue;
    38463848            }
     3849
     3850            /* Repaint the display because VM continued to run during the framebuffer resize. */
     3851            pDisplay->InvalidateAndUpdateEMT(pDisplay, uScreenId, false);
     3852
    38473853            /* Continue with normal processing because the status here is ResizeStatus_Void. */
    38483854        }
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