VirtualBox

Changeset 24971 in vbox for trunk/src


Ignore:
Timestamp:
Nov 25, 2009 5:03:25 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt: do not send resize hints for guest-initiated resizes

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h

    r24488 r24971  
    259259
    260260    void setDesktopGeometry (DesktopGeo aGeo, int aWidth, int aHeight);
    261     void setDesktopGeoHint (int aWidth, int aHeight);
     261    void storeConsoleSize (int aWidth, int aHeight);
    262262    void calculateDesktopGeometry();
    263263    void maybeRestrictMinimumSize();
     
    365365    DesktopGeo mDesktopGeo;
    366366    QRect mDesktopGeometry;
    367     QRect mLastSizeHint;
     367    QRect mStoredConsoleSize;
    368368    bool mPassCAD;
    369369    bool mHideHostPointer;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r24771 r24971  
    12721272                LogFlow (("VBoxDefs::ResizeEventType: %d x %d x %d bpp\n",
    12731273                          re->width(), re->height(), re->bitsPerPixel()));
    1274 
     1274#ifdef DEBUG_michael
     1275                LogRel (("Resize event from guest: %d x %d x %d bpp\n",
     1276                         re->width(), re->height(), re->bitsPerPixel()));
     1277#endif
     1278
     1279                /* Store the new size to prevent unwanted resize hints being
     1280                 * sent back. */
     1281                storeConsoleSize(re->width(), re->height());
    12751282                /* do frame buffer dependent resize */
    12761283
     
    13541361                {
    13551362                    mIgnoreFrameBufferResize = false;
    1356                     doResizeHint (mNormalSize);
    13571363                }
    13581364
     
    26932699        case DesktopGeo_Automatic:
    26942700            rc = QRect (0, 0,
    2695                         RT_MAX (mDesktopGeometry.width(), mLastSizeHint.width()),
    2696                         RT_MAX (mDesktopGeometry.height(), mLastSizeHint.height()));
     2701                        RT_MAX (mDesktopGeometry.width(), mStoredConsoleSize.width()),
     2702                        RT_MAX (mDesktopGeometry.height(), mStoredConsoleSize.height()));
    26972703            break;
    26982704        case DesktopGeo_Any:
     
    40174023        if (!aToSize.isValid())
    40184024            sz -= QSize (frameWidth() * 2, frameWidth() * 2);
     4025        /* Do not send out useless hints. */
     4026        if ((sz.width() == mStoredConsoleSize.width()) &&
     4027            (sz.height() == mStoredConsoleSize.height()))
     4028            return;
    40194029        /* We only actually send the hint if
    40204030         * 1) the autoresize property is set to true and
     
    40294039            LogFlowFunc (("Will suggest %d x %d\n", sz.width(), sz.height()));
    40304040
    4031             /* Increase the maximum allowed size to the new size if needed. */
    4032             setDesktopGeoHint (sz.width(), sz.height());
     4041            /* Remember the new size. */
     4042            storeConsoleSize (sz.width(), sz.height());
    40334043
    40344044            mConsole.GetDisplay().SetVideoModeHint (sz.width(), sz.height(), 0, 0);
     
    40474057
    40484058/**
    4049  * Remember a geometry hint sent by the console window.  This is used to
    4050  * determine the maximum supported guest resolution in the @a desktopGeometry
    4051  * method.  A hint will always override other restrictions.
     4059 * Store the current size of the console (i.e. the viewport to the guest).
     4060 * This has two purposes.  One is to suppress unwanted resize events for
     4061 * which the new size is the same as the stored size.  The other is to expand
     4062 * the maximum size to which we will let the guest resize itself.  It makes
     4063 * no sense to forbid guest resizes which are less than the current resolution
     4064 * anyway.
    40524065 *
    40534066 * @param aWidth  width of the resolution hint
    40544067 * @param aHeight height of the resolution hint
    40554068 */
    4056 void VBoxConsoleView::setDesktopGeoHint (int aWidth, int aHeight)
     4069void VBoxConsoleView::storeConsoleSize (int aWidth, int aHeight)
    40574070{
    40584071    LogFlowThisFunc (("aWidth=%d, aHeight=%d\n", aWidth, aHeight));
    4059     mLastSizeHint = QRect (0, 0, aWidth, aHeight);
     4072    mStoredConsoleSize = QRect (0, 0, aWidth, aHeight);
    40604073}
    40614074
     
    40924105            else
    40934106                mDesktopGeometry = QRect (0, 0, 0, 0);
    4094             setDesktopGeoHint (0, 0);
     4107            storeConsoleSize (0, 0);
    40954108            break;
    40964109        case DesktopGeo_Automatic:
    40974110            mDesktopGeo = DesktopGeo_Automatic;
    40984111            mDesktopGeometry = QRect (0, 0, 0, 0);
    4099             setDesktopGeoHint (0, 0);
     4112            storeConsoleSize (0, 0);
    41004113            break;
    41014114        case DesktopGeo_Any:
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