VirtualBox

Changeset 38949 in vbox


Ignore:
Timestamp:
Oct 5, 2011 10:00:25 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: use the QEvent::spontaneous() property to see if a resize was user initiated

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

Legend:

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

    r38947 r38949  
    248248    , m_previousState(KMachineState_Null)
    249249    , m_desktopGeometryType(DesktopGeo_Invalid)
    250     , m_bIsMachineWindowResizeIgnored(false)
    251250    , m_fShouldWeDoResize(false)
    252251#ifdef VBOX_WITH_VIDEOHWACCEL
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r38947 r38949  
    122122    ulong screenId() const { return m_uScreenId; }
    123123    UIFrameBuffer* frameBuffer() const { return m_pFrameBuffer; }
    124     bool isMachineWindowResizeIgnored() const { return m_bIsMachineWindowResizeIgnored; }
    125124    const QPixmap& pauseShot() const { return m_pauseShot; }
    126125    QSize storedConsoleSize() const { return m_storedConsoleSize; }
     
    132131    void setDesktopGeometry(DesktopGeo geometry, int iWidth, int iHeight);
    133132    void storeConsoleSize(int iWidth, int iHeight);
    134     void setMachineWindowResizeIgnored(bool fIgnore = true) { m_bIsMachineWindowResizeIgnored = fIgnore; }
    135133    void storeGuestSizeHint(const QSize &sizeHint);
    136134
     
    179177    QSize m_storedConsoleSize;
    180178
    181     bool m_bIsMachineWindowResizeIgnored : 1;
    182179    bool m_fShouldWeDoResize : 1;
    183180#ifdef VBOX_WITH_VIDEOHWACCEL
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r38947 r38949  
    117117                return true;
    118118
    119             /* We are starting to perform machine-view resize,
    120              * we should temporary ignore other if they are trying to be: */
    121             bool fWasMachineWindowResizeIgnored = isMachineWindowResizeIgnored();
    122             setMachineWindowResizeIgnored(true);
    123 
    124119            /* Get guest resize-event: */
    125120            UIResizeEvent *pResizeEvent = static_cast<UIResizeEvent*>(pEvent);
     
    152147            /* Report to the VM thread that we finished resizing: */
    153148            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
    154 
    155             /* We are finishing to perform machine-view resize: */
    156             setMachineWindowResizeIgnored(fWasMachineWindowResizeIgnored);
    157149
    158150            /* We also recalculate the desktop geometry if this is determined
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r38947 r38949  
    107107                return true;
    108108
    109             /* We are starting to perform machine-view resize,
    110              * we should temporary ignore other if they are trying to be: */
    111             bool fWasMachineWindowResizeIgnored = isMachineWindowResizeIgnored();
    112             setMachineWindowResizeIgnored(true);
    113 
    114109            /* Get guest resize-event: */
    115110            UIResizeEvent *pResizeEvent = static_cast<UIResizeEvent*>(pEvent);
     
    145140            /* Report to the VM thread that we finished resizing: */
    146141            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
    147 
    148             /* We are finishing to perform machine-view resize: */
    149             setMachineWindowResizeIgnored(fWasMachineWindowResizeIgnored);
    150142
    151143            /* We also recalculate the desktop geometry if this is determined
     
    185177                 * This hint is acted upon when (and only when) the autoresize property is "true": */
    186178                m_fShouldWeDoResize = uisession()->isGuestSupportsGraphics();
    187                 if (!isMachineWindowResizeIgnored() && m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
     179                if (pEvent->spontaneous() && m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
    188180                    QTimer::singleShot(300, this, SLOT(sltPerformGuestResize()));
    189181                break;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r33595 r38949  
    169169                return true;
    170170
    171             /* We are starting to perform machine-view resize,
    172              * we should temporary ignore other if they are trying to be: */
    173             bool fWasMachineWindowResizeIgnored = isMachineWindowResizeIgnored();
    174             setMachineWindowResizeIgnored(true);
    175 
    176171            /* Get guest resize-event: */
    177172            UIResizeEvent *pResizeEvent = static_cast<UIResizeEvent*>(pEvent);
     
    193188            /* Report to the VM thread that we finished resizing: */
    194189            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
    195 
    196             /* We are finishing to perform machine-view resize: */
    197             setMachineWindowResizeIgnored(fWasMachineWindowResizeIgnored);
    198190
    199191            /* We also recalculate the desktop geometry if this is determined
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r38948 r38949  
    128128                return true;
    129129
    130             /* We are starting to perform machine-view resize,
    131              * we should temporary ignore other if they are trying to be: */
    132             bool fWasMachineWindowResizeIgnored = isMachineWindowResizeIgnored();
    133             setMachineWindowResizeIgnored(true);
    134 
    135130            /* Get guest resize-event: */
    136131            UIResizeEvent *pResizeEvent = static_cast<UIResizeEvent*>(pEvent);
     
    160155            /* Report to the VM thread that we finished resizing: */
    161156            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
    162 
    163             /* We are finishing to perform machine-view resize: */
    164             setMachineWindowResizeIgnored(fWasMachineWindowResizeIgnored);
    165157
    166158            /* We also recalculate the desktop geometry if this is determined
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