VirtualBox

Changeset 56443 in vbox for trunk


Ignore:
Timestamp:
Jun 16, 2015 10:20:52 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101060
Message:

FE/Qt: fix sending of initial mode hints.

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

Legend:

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

    r56145 r56443  
    338338    foreach(UIMachineWindow *pMachineWindow, machineWindows())
    339339        pMachineWindow->adjustMachineViewSize();
     340}
     341
     342void UIMachineLogic::sendMachineWindowsSizeHints()
     343{
     344    /* By default, the only thing we need is to
     345     * send machine-view(s) size-hint(s) to the guest: */
     346    foreach(UIMachineWindow *pMachineWindow, machineWindows())
     347        pMachineWindow->sendMachineViewSizeHint();
    340348}
    341349
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r56098 r56443  
    128128    virtual void adjustMachineWindowsGeometry();
    129129
     130    /** Send machine-window(s) size-hint(s) to the guest. */
     131    virtual void sendMachineWindowsSizeHints();
     132
    130133    /* Wrapper to open Machine settings / Network page: */
    131134    void openNetworkSettingsDialog() { sltOpenNetworkSettingsDialog(); }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r56321 r56443  
    9393    /* Public setters: */
    9494    virtual void setGuestAutoresizeEnabled(bool /* fEnabled */) {}
     95
     96    /** Send saved guest-screen size-hint to the guest.
     97      * @note Reimplemented in sub-classes. Base implementation does nothing. */
     98    virtual void resendSizeHint() {}
    9599
    96100    /** Adjusts guest-screen size to correspond current visual-style.
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r56126 r56443  
    228228    /* We need to adjust guest-screen size if necessary: */
    229229    machineView()->adjustGuestScreenSize();
     230}
     231
     232void UIMachineWindow::sendMachineViewSizeHint()
     233{
     234    /* Send machine-view size-hint to the guest: */
     235    machineView()->resendSizeHint();
    230236}
    231237
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r55401 r56443  
    8484    /** Adjusts machine-view size to correspond current machine-window size. */
    8585    virtual void adjustMachineViewSize();
     86
     87    /** Sends machine-view size-hint to the guest. */
     88    virtual void sendMachineViewSizeHint();
    8689
    8790#ifdef VBOX_WITH_MASKED_SEAMLESS
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r56133 r56443  
    287287    }
    288288    else
     289    {
    289290        msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_start_90px.png");
     291        /* After VM start, machine-window(s) size-hint(s) should be sent: */
     292        machineLogic()->sendMachineWindowsSizeHints();
     293    }
    290294
    291295    /* Check for progress failure: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r55939 r56443  
    137137void UIMachineViewNormal::resendSizeHint()
    138138{
    139     const QSize sizeHint = guestSizeHint();
     139    /* Get the last size hint, taking the scale factor into account. */
     140    const QSize sizeHint = scaledBackward(guestSizeHint());
    140141    LogRel(("GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen %d to %dx%d\n",
    141142            (int)screenId(), sizeHint.width(), sizeHint.height()));
    142143    /* Temporarily restrict the size to prevent a brief resize to the
    143144     * framebuffer dimensions (see @a UIMachineView::sizeHint()) before
    144      * the following resize() is acted upon. */
     145     * the following resize() is acted upon.  Expand current limitations
     146     * too. */
    145147    setMaximumSize(sizeHint);
    146148    m_sizeHintOverride = sizeHint;
    147     sltPerformGuestResize(sizeHint);
     149    display().SetVideoModeHint(screenId(), true, false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
    148150}
    149151
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r55939 r56443  
    153153void UIMachineViewScale::resendSizeHint()
    154154{
    155     const QSize sizeHint = guestSizeHint();
     155    const QSize sizeHint = scaledBackward(guestSizeHint());
    156156    LogRel(("GUI: UIMachineViewScale::resendSizeHint: Restoring guest size-hint for screen %d to %dx%d\n",
    157157            (int)screenId(), sizeHint.width(), sizeHint.height()));
    158     sltPerformGuestResize(sizeHint);
     158    /* Expand current limitations: */
     159    setMaxGuestSize(sizeHint);
     160    display().SetVideoModeHint(screenId(), true, false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
    159161}
    160162
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette