VirtualBox

Ignore:
Timestamp:
Sep 21, 2012 11:38:32 AM (12 years ago)
Author:
vboxsync
Message:

BUGZ:6387 Notify guest about host window geometry change when restoring from saved state.

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

Legend:

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

    r43169 r43395  
    2929#include "UIActionPoolRuntime.h"
    3030#include "UIMachineLogic.h"
     31#include "UIMachineView.h"
    3132#include "UIMachineWindow.h"
    3233#include "UIMachineMenuBar.h"
     
    148149}
    149150
     151void UISession::adjustGuestView()
     152{
     153    foreach(UIMachineWindow *pMachineWindow, machineLogic()->machineWindows())
     154    {
     155        bool bAdjustPosition = True;
     156        UIVisualStateType visualStateType = machineLogic()->visualStateType();
     157
     158        if (visualStateType == UIVisualStateType_Normal ||
     159            visualStateType == UIVisualStateType_Scale)
     160            bAdjustPosition = True;
     161
     162        /* Normalize view's geometry: */
     163        pMachineWindow->machineView()->normalizeGeometry(bAdjustPosition);
     164    }
     165}
     166
    150167void UISession::powerUp()
    151168{
     
    198215    /* Show "Starting/Restoring" progress dialog: */
    199216    if (isSaved())
     217    {
    200218        msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_restore_90px.png", mainMachineWindow(), true, 0);
     219        /* If restoring from saved state, guest MachineView
     220           should be notified about host MachineWindow geometry change */
     221        adjustGuestView();
     222
     223    }
    201224    else
    202225        msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_start_90px.png", mainMachineWindow(), true);
     
    11331156    foreach (const CHostNetworkInterface &iface, vboxGlobal().host().GetNetworkInterfaces())
    11341157    {
    1135         availableInterfaceNames << iface.GetName();
     1158        availableInterfaceNames << iface.GetName();
    11361159    }
    11371160
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r43138 r43395  
    229229    void reinitMenuPool();
    230230    bool preparePowerUp();
     231    void adjustGuestView();
    231232
    232233#ifdef VBOX_GUI_WITH_KEYS_RESET_HANDLER
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r42323 r43395  
    162162}
    163163
     164void UIMachineViewFullscreen::normalizeGeometry(bool /* fAdjustPosition */)
     165{
     166    sltPerformGuestResize(workingArea().size());
     167}
     168
    164169QRect UIMachineViewFullscreen::workingArea() const
    165170{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h

    r39081 r43395  
    6565
    6666    /* Private helpers: */
    67     void normalizeGeometry(bool /* fAdjustPosition */) {}
     67    void normalizeGeometry(bool /* fAdjustPosition */);
    6868    QRect workingArea() const;
    6969    QSize calculateMaxGuestSize() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r43022 r43395  
    227227    QWidget *pTopLevelWidget = window();
    228228
    229     /* Make no normalizeGeometry in case we are in manual resize mode or main window is maximized: */
    230     if (pTopLevelWidget->isMaximized())
    231         return;
    232 
    233229    /* Calculate client window offsets: */
    234230    QRect frameGeo = pTopLevelWidget->frameGeometry();
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