VirtualBox

Changeset 42318 in vbox


Ignore:
Timestamp:
Jul 23, 2012 9:27:05 AM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: attempt to fix auto-resize in the face of host resolution changes.

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

Legend:

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

    r42248 r42318  
    181181    QString strKey = makeExtraDataKeyPerMonitor(GUI_LastGuestSizeHintWasFullscreen);
    182182    machine.SetExtraData(strKey, isFullscreenOrSeamless() ? "true" : "");
     183}
     184
     185void UIMachineView::sltDesktopResized()
     186{
     187    setMaxGuestSize();
    183188}
    184189
     
    494499}
    495500
     501void UIMachineView::prepareConnections()
     502{
     503    /* Desktop resolution change (e.g. monitor hotplug): */
     504    connect(QApplication::desktop(), SIGNAL(resized(int)), this,
     505            SLOT(sltDesktopResized()));
     506}
     507
    496508void UIMachineView::prepareConsoleConnections()
    497509{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r41689 r42318  
    9292    void sltPerformGuestResize(const QSize &aSize = QSize());
    9393
     94    /* Watch dog for desktop resizes: */
     95    void sltDesktopResized();
     96
    9497    /* Console callback handlers: */
    9598    virtual void sltMachineStateChanged();
     
    112115    virtual void prepareCommon();
    113116    virtual void prepareFilters();
     117    virtual void prepareConnections();
    114118    virtual void prepareConsoleConnections();
    115119    virtual void loadMachineViewSettings();
     
    139143    const QPixmap& pauseShot() const { return m_pauseShot; }
    140144    /** Atomically store the maximum guest resolution which we currently wish
    141      * to handle for @a maxGuestSize() to read. */
     145     * to handle for @a maxGuestSize() to read.  Should be called if anything
     146     * happens (e.g. a screen hotplug) which might cause the value to change.
     147     * @sa m_u64MaxGuestSize. */
    142148    void setMaxGuestSize();
    143149    /** Atomically read the maximum guest resolution which we currently wish to
    144150     * handle.  This may safely be called from another thread (called by
    145      * UIFramebuffer on EMT). */
     151     * UIFramebuffer on EMT).
     152     * @sa m_u64MaxGuestSize. */
    146153    QSize maxGuestSize();
    147154    /** Retrieve the last non-fullscreen guest size hint (from extra data).
     
    225232    QSize m_fixedMaxGuestSize;
    226233    /** Maximum guest resolution which we wish to handle.  Must be accessed
    227      * atomically. */
     234     * atomically.
     235     * @note The background for this variable is that we need this value to be
     236     * available to the EMT thread, but it can only be calculated by the
     237     * GUI, and GUI code can only safely be called on the GUI thread due to
     238     * (at least) X11 threading issues.  So we calculate the value in advance,
     239     * monitor things in case it changes and update it atomically when it does.
     240     */
    228241    /** @todo This should be private. */
    229242    volatile uint64_t m_u64MaxGuestSize;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r41689 r42318  
    6868    prepareFilters();
    6969
     70    /* Prepare connections: */
     71    prepareConnections();
     72
    7073    /* Prepare console connections: */
    7174    prepareConsoleConnections();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r41689 r42318  
    6363    /* Prepare event-filters: */
    6464    prepareFilters();
     65
     66    /* Prepare connections: */
     67    prepareConnections();
    6568
    6669    /* Prepare console connections: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r41689 r42318  
    6868    prepareFilters();
    6969
     70    /* Prepare connections: */
     71    prepareConnections();
     72
    7073    /* Prepare console connections: */
    7174    prepareConsoleConnections();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r41689 r42318  
    7272    prepareFilters();
    7373
     74    /* Prepare connections: */
     75    prepareConnections();
     76
    7477    /* Prepare console connections: */
    7578    prepareConsoleConnections();
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