VirtualBox

Changeset 48644 in vbox for trunk


Ignore:
Timestamp:
Sep 23, 2013 5:54:48 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89238
Message:

FE/Qt: limit the maximum recommended guest screen size before the window is visible, make the code and comments more future-proof.

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

Legend:

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

    r48642 r48644  
    248248QSize UIMachineViewNormal::calculateMaxGuestSize() const
    249249{
     250    /* 1) The calculation below is not reliable on some (X11) platforms until we
     251     *    have been visible for a fraction of a second, so so the best we can
     252     *    otherwise.
     253     * 2) We also get called early before "machineWindow" has been fully
     254     *    initialised, at which time we can't perform the calculation. */
     255    if (!isVisible())
     256        return workingArea().size() * 0.95;
    250257    /* The area taken up by the machine window on the desktop, including window
    251258     * frame, title, menu bar and status bar. */
     
    257264    /* The current size of the machine display. */
    258265    QSize centralWidgetSize = machineWindow()->centralWidget()->size();
    259     /* The calculation below is not reliable on some (X11) platforms until we
    260      * have been visible for a fraction of a second, so so the best we can
    261      * otherwise. */
    262     if (!isVisible())
    263         return workingArea().size() * 0.95;
    264266    /* To work out how big the guest display can get without the window going
    265267     * over the maximum size we calculated above, we work out how much space
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r48642 r48644  
    196196QSize UIMachineViewScale::calculateMaxGuestSize() const
    197197{
     198    /* 1) The calculation below is not reliable on some (X11) platforms until we
     199     *    have been visible for a fraction of a second, so so the best we can
     200     *    otherwise.
     201     * 2) We also get called early before "machineWindow" has been fully
     202     *    initialised, at which time we can't perform the calculation. */
     203    if (!isVisible())
     204        return workingArea().size() * 0.95;
    198205    /* The area taken up by the machine window on the desktop, including window
    199206     * frame, title, menu bar and status bar. */
     
    205212    /* The current size of the machine display. */
    206213    QSize centralWidgetSize = machineWindow()->centralWidget()->size();
    207     /* The calculation below is not reliable on some (X11) platforms until we
    208      * have been visible for a fraction of a second, so so the best we can
    209      * otherwise. */
    210     if (!isVisible())
    211         return workingArea().size() * 0.95;
    212214    /* To work out how big the guest display can get without the window going
    213215     * over the maximum size we calculated above, we work out how much space
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