VirtualBox

Changeset 61985 in vbox for trunk


Ignore:
Timestamp:
Jul 1, 2016 3:26:45 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8422: Runtime UI: Seamless window: Extended minimized state handling as done for full-screen window under Qt5 (s.a. r108013, r108415, r108422).

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

Legend:

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

    r61982 r61985  
    5050    , m_pMiniToolBar(0)
    5151#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
     52    , m_fWasMinimized(false)
    5253{
    5354}
     
    186187    AssertPtrReturnVoid(pSeamlessLogic);
    187188
    188     /* Make sure window should be shown and mapped to some host-screen: */
     189    /* If window shouldn't be shown or mapped to some host-screen: */
    189190    if (!uisession()->isScreenVisible(m_uScreenId) ||
    190191        !pSeamlessLogic->hasHostScreenForGuestScreen(m_uScreenId))
    191192    {
    192         /* Hide window: */
     193        /* Remember whether the window was minimized: */
     194        if (isMinimized())
     195            m_fWasMinimized = true;
     196
     197        /* Hide window and reset it's state to NONE: */
     198        setWindowState(Qt::WindowNoState);
    193199        hide();
    194200    }
     201    /* If window should be shown and mapped to some host-screen: */
    195202    else
    196203    {
    197         /* Ignore if window minimized: */
    198         if (isMinimized())
    199             return;
     204        /* Check whether window was minimized: */
     205        const bool fWasMinimized = isMinimized() && isVisible();
     206        /* And reset it's state in such case before exposing: */
     207        if (fWasMinimized)
     208            setWindowState(Qt::WindowNoState);
    200209
    201210        /* Make sure window have appropriate geometry: */
     
    204213        /* Show window in normal mode: */
    205214        show();
     215
     216        /* Restore minimized state if necessary: */
     217        if (m_fWasMinimized || fWasMinimized)
     218        {
     219            m_fWasMinimized = false;
     220            QMetaObject::invokeMethod(this, "showMinimized", Qt::QueuedConnection);
     221        }
    206222
    207223        /* Adjust machine-view size if necessary: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r60362 r61985  
    9898#endif /* VBOX_WITH_MASKED_SEAMLESS */
    9999
     100    /** Holds whether the window was minimized before became hidden.
     101      * Used to restore minimized state when the window shown again. */
     102    bool m_fWasMinimized;
     103
    100104    /** Factory support. */
    101105    friend class UIMachineWindow;
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