VirtualBox

Ignore:
Timestamp:
Jul 25, 2014 2:09:02 PM (10 years ago)
Author:
vboxsync
Message:

Additions/x11/VBoxClient: make remembering screen size between sessions work for multiple monitors, second series.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/display.cpp

    r52177 r52189  
    219219static void runDisplay(struct x11State *pState)
    220220{
    221     int status, rc, i;
     221    int status, rc;
     222    unsigned i, cScreens;
    222223    char szCommand[256];
    223224    Cursor hClockCursor = XCreateFontCursor(pState->pDisplay, XC_watch);
     
    225226
    226227    LogRelFlowFunc(("\n"));
    227     /** @todo fix this not to use a hard-coded value. */
    228     for (i = 0; i < 64; ++i)
     228    rc = VbglR3VideoModeGetHighestSavedScreen(&cScreens);
     229    if (RT_FAILURE(rc))
     230        FatalError(("Failed to get the number of saved screen modes, rc=%Rrc\n",
     231                    rc));
     232    for (i = 0; i < RT_MAX(cScreens + 1, 8); ++i)
    229233    {
    230234        unsigned cx = 0, cy = 0, cBPP = 0, x = 0, y = 0;
     
    233237        rc = VbglR3RetrieveVideoMode(i, &cx, &cy, &cBPP, &x, &y,
    234238                                     &fEnabled);
     239        if (RT_SUCCESS(rc) && i > cScreens) /* Sanity */
     240            FatalError(("Internal error retrieving the number of saved screen modes.\n"));
    235241        if (RT_SUCCESS(rc))
    236242            setModeX11(pState, cx, cy, cBPP, i, x, y, fEnabled,
     
    298304            rc = VbglR3SeamlessGetLastEvent(&Mode);
    299305            if (RT_FAILURE(rc))
    300                 FatalError(("Failed to save size hint, rc=%Rrc\n", rc));
     306                FatalError(("Failed to check seamless mode, rc=%Rrc\n", rc));
    301307            if (Mode == VMMDev_Seamless_Disabled)
    302308            {
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