VirtualBox

Ignore:
Timestamp:
Jan 22, 2015 6:50:14 AM (10 years ago)
Author:
vboxsync
Message:

Host 3D: do not upset GUI when it attempts to set scale factor when 3D output not yet initialized. Cache it and restore once output initialized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/server_presenter.cpp

    r53889 r53908  
    18441844        {
    18451845            bool rc;
     1846            crDebug("Set scale factor for initialized display.");
    18461847            rc = pWin->SetScaleFactor((GLdouble)dScaleFactorW, (GLdouble)dScaleFactorH);
    18471848            return rc ? 0 : VERR_LOCK_FAILED;
    18481849        }
    18491850        else
    1850             crDebug("Can't set scale factor bacause overlay window obgect not yet created.");
     1851            crDebug("Can't apply scale factor at the moment bacause overlay window obgect not yet created. Will be chached.");
    18511852    }
    18521853    else
    1853         crDebug("Can't set scale factor because specified screen ID cannot be mapped to list of available displays.");
    1854 
    1855     return VERR_INVALID_PARAMETER;
     1854        crDebug("Can't apply scale factor at the moment bacause display not yet initialized. Will be chached.");
     1855
     1856    /* Display output not yet initialized. Let's cache values. */
     1857    pDpInfo->dInitialScaleFactorW = dScaleFactorW;
     1858    pDpInfo->dInitialScaleFactorH = dScaleFactorH;
     1859
     1860    return 0;
    18561861}
    18571862
     
    21062111        pDpInfo->pDpWin = pDpInfo->pDpWinRootVr;
    21072112        pDpInfo->pDpWinRootVr->windowAttach(pDpInfo->pWindow);
     2113
     2114        /* Set scale factor once it was previously cached when display output was not yet initialized. */
     2115        if (pDpInfo->dInitialScaleFactorW || pDpInfo->dInitialScaleFactorH)
     2116        {
     2117            crDebug("Set cached scale factor for seamless mode.");
     2118            pDpInfo->pWindow->SetScaleFactor((GLdouble)pDpInfo->dInitialScaleFactorW, (GLdouble)pDpInfo->dInitialScaleFactorH);
     2119            /* Invalidate cache. */
     2120            pDpInfo->dInitialScaleFactorW = pDpInfo->dInitialScaleFactorH = 0;
     2121        }
    21082122    }
    21092123}
     
    21292143        pDpInfo->pDpWin = new CrFbDisplayWindow(&cr_server.screenVieport[pDpInfo->u32Id].Rect, cr_server.screen[pDpInfo->u32Id].winID);
    21302144        pDpInfo->pDpWin->windowAttach(pDpInfo->pWindow);
     2145
     2146        /* Set scale factor once it was previously cached when display output was not yet initialized. */
     2147        if (pDpInfo->dInitialScaleFactorW || pDpInfo->dInitialScaleFactorH)
     2148        {
     2149            crDebug("Set cached scale factor for host window.");
     2150            pDpInfo->pWindow->SetScaleFactor((GLdouble)pDpInfo->dInitialScaleFactorW, (GLdouble)pDpInfo->dInitialScaleFactorH);
     2151            /* Invalidate cache. */
     2152            pDpInfo->dInitialScaleFactorW = pDpInfo->dInitialScaleFactorH = 0;
     2153        }
    21312154    }
    21322155}
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