VirtualBox

Ignore:
Timestamp:
Oct 9, 2013 3:06:13 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Unify geometry normalization stuff for fullscreen and seamless modes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r48689 r49009  
    6363void UIMachineViewFullscreen::sltAdditionsStateChanged()
    6464{
    65     /* Check if we should resize guest to fullscreen */
    66     if ((int)frameBuffer()->width() != workingArea().size().width() ||
    67         (int)frameBuffer()->height() != workingArea().size().height())
    68         if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
    69             sltPerformGuestResize(workingArea().size());
     65    normalizeGeometry(false);
    7066}
    7167
     
    142138void UIMachineViewFullscreen::normalizeGeometry(bool /* fAdjustPosition */)
    143139{
    144     sltPerformGuestResize(workingArea().size());
     140    /* Check if we should adjust guest to new size: */
     141    if ((int)frameBuffer()->width() != workingArea().size().width() ||
     142        (int)frameBuffer()->height() != workingArea().size().height())
     143        if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
     144            sltPerformGuestResize(workingArea().size());
    145145}
    146146
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h

    r46361 r49009  
    4141private slots:
    4242
    43     /* Console callback handlers: */
     43    /* Handler: Console callback stuff: */
    4444    void sltAdditionsStateChanged();
    4545
     
    5656    /* Cleanup routines: */
    5757    //void cleanupConsoleConnections() {}
    58     //void cleanupConnections() {}
    5958    //void cleanupFilters() {}
    6059    //void cleanupCommon() {}
     
    6463
    6564    /* Private helpers: */
    66     void normalizeGeometry(bool /* fAdjustPosition */);
     65    void normalizeGeometry(bool fAdjustPosition);
    6766    QRect workingArea() const;
    6867    QSize calculateMaxGuestSize() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r48689 r49009  
    7070}
    7171
     72void UIMachineViewSeamless::sltAdditionsStateChanged()
     73{
     74    normalizeGeometry(false);
     75}
     76
    7277void UIMachineViewSeamless::sltHandleSetVisibleRegion(QRegion region)
    7378{
     
    126131}
    127132
     133void UIMachineViewSeamless::prepareConsoleConnections()
     134{
     135    /* Base class connections: */
     136    UIMachineView::prepareConsoleConnections();
     137
     138    /* Guest additions state-change updater: */
     139    connect(uisession(), SIGNAL(sigAdditionsStateChange()), this, SLOT(sltAdditionsStateChanged()));
     140}
     141
    128142void UIMachineViewSeamless::prepareSeamless()
    129143{
     
    138152        /* Reset seamless feature flag of the guest: */
    139153        session().GetConsole().GetDisplay().SetSeamlessMode(false);
     154}
     155
     156void UIMachineViewSeamless::normalizeGeometry(bool /* fAdjustPosition */)
     157{
     158    /* Check if we should adjust guest to new size: */
     159    if ((int)frameBuffer()->width() != workingArea().size().width() ||
     160        (int)frameBuffer()->height() != workingArea().size().height())
     161        if (uisession()->isGuestSupportsGraphics())
     162            sltPerformGuestResize(workingArea().size());
    140163}
    141164
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h

    r46364 r49009  
    4141private slots:
    4242
     43    /* Handler: Console callback stuff: */
     44    void sltAdditionsStateChanged();
     45
    4346    /* Handler: Frame-buffer SetVisibleRegion stuff: */
    4447    virtual void sltHandleSetVisibleRegion(QRegion region);
     
    5255    void prepareCommon();
    5356    void prepareFilters();
     57    void prepareConsoleConnections();
    5458    void prepareSeamless();
    5559
    5660    /* Cleanup helpers: */
    5761    void cleanupSeamless();
     62    //void cleanupConsoleConnections() {}
    5863    //void cleanupFilters() {}
    5964    //void cleanupCommon() {}
    6065
    6166    /* Private helpers: */
    62     void normalizeGeometry(bool /* fAdjustPosition */) {}
     67    void normalizeGeometry(bool fAdjustPosition);
    6368    QRect workingArea() const;
    6469    QSize calculateMaxGuestSize() const;
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