VirtualBox

Changeset 65800 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Feb 16, 2017 1:20:32 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113533
Message:

FE/Qt: X11: Runtime UI: Prevent instant restore to full-screen/seamless modes right after minimization call; issue caused by async minimization handling.

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

Legend:

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

    r65520 r65800  
    6161    , m_fWasMinimized(false)
    6262#ifdef VBOX_WS_X11
     63    , m_fIsMinimizationRequested(false)
    6364    , m_fIsMinimized(false)
    6465#endif
     
    136137void UIMachineWindowFullscreen::sltRevokeWindowActivation()
    137138{
     139#ifdef VBOX_WS_X11
     140    // WORKAROUND:
     141    // We could be asked to minimize already, but just
     142    // not yet executed that order to current moment.
     143    if (m_fIsMinimizationRequested)
     144        return;
     145#endif
     146
    138147    /* Make sure window is visible: */
    139148    if (!isVisible() || isMinimized())
     
    198207}
    199208#endif /* VBOX_WS_MAC */
     209
     210void UIMachineWindowFullscreen::sltShowMinimized()
     211{
     212#ifdef VBOX_WS_X11
     213    /* Remember that we are asked to minimize: */
     214    m_fIsMinimizationRequested = true;
     215#endif
     216
     217    showMinimized();
     218}
    200219
    201220void UIMachineWindowFullscreen::prepareVisualState()
     
    261280        m_pMiniToolBar->addMenus(actionPool()->menus());
    262281        connect(m_pMiniToolBar, SIGNAL(sigMinimizeAction()),
    263                 this, SLOT(showMinimized()), Qt::QueuedConnection);
     282                this, SLOT(sltShowMinimized()), Qt::QueuedConnection);
    264283        connect(m_pMiniToolBar, SIGNAL(sigExitAction()),
    265284                actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen), SLOT(trigger()));
     
    564583                LogRel2(("GUI: UIMachineWindowFullscreen::changeEvent: Window restored\n"));
    565584                m_fIsMinimized = false;
     585                /* Remember that we no more asked to minimize: */
     586                m_fIsMinimizationRequested = false;
    566587                showInNecessaryMode();
    567588            }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r65520 r65800  
    7676#endif /* RT_OS_DARWIN */
    7777
     78    /** Shows window in minimized state. */
     79    void sltShowMinimized();
     80
    7881private:
    7982
     
    128131    bool m_fWasMinimized;
    129132#ifdef VBOX_WS_X11
     133    /** X11: Holds whether the window minimization is currently requested.
     134      * Used to prevent accidentally restoring to full-screen state. */
     135    bool m_fIsMinimizationRequested;
    130136    /** X11: Holds whether the window is currently minimized.
    131137      * Used to restore full-screen state when the window restored again. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r65520 r65800  
    5353    , m_fWasMinimized(false)
    5454#ifdef VBOX_WS_X11
     55    , m_fIsMinimizationRequested(false)
    5556    , m_fIsMinimized(false)
    5657#endif
     
    7071void UIMachineWindowSeamless::sltRevokeWindowActivation()
    7172{
     73#ifdef VBOX_WS_X11
     74    // WORKAROUND:
     75    // We could be asked to minimize already, but just
     76    // not yet executed that order to current moment.
     77    if (m_fIsMinimizationRequested)
     78        return;
     79#endif
     80
    7281    /* Make sure window is visible: */
    7382    if (!isVisible() || isMinimized())
     
    8190}
    8291#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
     92
     93void UIMachineWindowSeamless::sltShowMinimized()
     94{
     95#ifdef VBOX_WS_X11
     96    /* Remember that we are asked to minimize: */
     97    m_fIsMinimizationRequested = true;
     98#endif
     99
     100    showMinimized();
     101}
    83102
    84103void UIMachineWindowSeamless::prepareVisualState()
     
    125144        m_pMiniToolBar->addMenus(actionPool()->menus());
    126145        connect(m_pMiniToolBar, SIGNAL(sigMinimizeAction()),
    127                 this, SLOT(showMinimized()), Qt::QueuedConnection);
     146                this, SLOT(sltShowMinimized()), Qt::QueuedConnection);
    128147        connect(m_pMiniToolBar, SIGNAL(sigExitAction()),
    129148                actionPool()->action(UIActionIndexRT_M_View_T_Seamless), SLOT(trigger()));
     
    323342                LogRel2(("GUI: UIMachineWindowSeamless::changeEvent: Window restored\n"));
    324343                m_fIsMinimized = false;
     344                /* Remember that we no more asked to minimize: */
     345                m_fIsMinimizationRequested = false;
    325346                showInNecessaryMode();
    326347            }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r65520 r65800  
    4747    void sltRevokeWindowActivation();
    4848#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
     49
     50    /** Shows window in minimized state. */
     51    void sltShowMinimized();
    4952
    5053private:
     
    105108    bool m_fWasMinimized;
    106109#ifdef VBOX_WS_X11
     110    /** X11: Holds whether the window minimization is currently requested.
     111      * Used to prevent accidentally restoring to seamless state. */
     112    bool m_fIsMinimizationRequested;
    107113    /** X11: Holds whether the window is currently minimized.
    108114      * Used to restore maximized state when the window restored again. */
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