VirtualBox

Changeset 71085 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 21, 2018 1:24:04 PM (7 years ago)
Author:
vboxsync
Message:

WDDM/VBoxTray: bugref:8444: Get rid of the loop over displays

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp

    r71070 r71085  
    15081508
    15091509    vboxDispIfTargetConnectivityWDDM(&Op, iChangedMode, fEnable? 1: 0);
    1510 
    1511     /* Resize displays always to keep the display layout because
    1512      * "the D3DKMTInvalidateActiveVidPn function always resets a multimonitor desktop to the default configuration".
    1513      */
    1514 
    1515     if (fEnable || RT_BOOL(paDisplayDevices[iChangedMode].StateFlags & DISPLAY_DEVICE_ACTIVE))
     1510   
     1511    /* Whether the current display is already or should be enabled. */
     1512    BOOL fChangedEnable = fEnable || RT_BOOL(paDisplayDevices[iChangedMode].StateFlags & DISPLAY_DEVICE_ACTIVE);
     1513
     1514    if (fCurrentEnable)
    15161515    {
    15171516        RTRECTSIZE Size;
     
    15221521        LogFunc(("Calling vboxDispIfUpdateModesWDDM to change target %d mode to (%d x %d)\n", iChangedMode, Size.cx, Size.cy));
    15231522        winEr = vboxDispIfUpdateModesWDDM(&Op, iChangedMode, &Size);
    1524 
    1525         if (winEr != NO_ERROR)
    1526             WARN(("vboxDispIfUpdateModesWDDM failed %d\n", winEr));
    1527     }
    1528 
    1529     for (uint32_t i = 0; i < cDevModes; ++i)
    1530     {
     1523    }
     1524
     1525    winEr = vboxDispIfResizePerform(pIf, iChangedMode, fChangedEnable, fExtDispSup, paDisplayDevices, paDeviceModes, cDevModes);
     1526
     1527    if (winEr == ERROR_RETRY)
     1528    {
     1529        VBoxRrRetrySchedule(pIf, iChangedMode, fChangedEnable, fExtDispSup, paDisplayDevices, paDeviceModes, cDevModes);
     1530
    15311531        winEr = NO_ERROR;
    1532 
    1533         /* Whether the current display should be enabled. */
    1534         BOOL fCurrentEnable = i == iChangedMode?
    1535                                  fEnable:
    1536                                  RT_BOOL(paDisplayDevices[i].StateFlags & DISPLAY_DEVICE_ACTIVE);
    1537 
    1538         winEr = vboxDispIfResizePerform(pIf, i, fCurrentEnable, fExtDispSup, paDisplayDevices, paDeviceModes, cDevModes);
    1539 
    1540         LogFunc(("vboxDispIfResizePerform returned %d\n", winEr));
    1541 
    1542         if (winEr == ERROR_RETRY)
    1543         {
    1544             VBoxRrRetrySchedule(pIf, i, fCurrentEnable, fExtDispSup, paDisplayDevices, paDeviceModes, cDevModes);
    1545 
    1546             winEr = NO_ERROR;
    1547         }
    15481532    }
    15491533
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