VirtualBox

Ignore:
Timestamp:
Aug 14, 2014 1:27:19 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95525
Message:

FE/Qt: Runtime UI: Make sure mini-toolbar of hidden machine-window is hidden too; merging latest changes from full-screen to seamless mode.

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

Legend:

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

    r52370 r52382  
    166166void UIMachineWindowFullscreen::sltRevokeFocus()
    167167{
     168    /* Make sure window is visible: */
     169    if (!isVisible())
     170        return;
     171
    168172    /* Revoke stolen focus: */
    169173    m_pMachineView->setFocus();
     
    314318    if (!uisession()->isScreenVisible(m_uScreenId) ||
    315319        !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
    316         return hide();
     320    {
     321        /* Hide mini-toolbar: */
     322        if (m_pMiniToolBar)
     323            m_pMiniToolBar->hide();
     324        /* Hide window: */
     325        hide();
     326        return;
     327    }
    317328
    318329    /* Make sure this window is not minimized: */
     
    368379    machineView()->maybeAdjustGuestScreenSize();
    369380
    370     /* Move mini-toolbar into appropriate place: */
     381    /* Show/Move mini-toolbar into appropriate place: */
    371382    if (m_pMiniToolBar)
     383    {
     384        m_pMiniToolBar->show();
    372385        m_pMiniToolBar->adjustGeometry(iHostScreen);
     386    }
    373387}
    374388
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r52370 r52382  
    6363void UIMachineWindowSeamless::sltRevokeFocus()
    6464{
     65    /* Make sure window is visible: */
     66    if (!isVisible())
     67        return;
     68
    6569    /* Revoke stolen focus: */
    6670    m_pMachineView->setFocus();
     
    158162    /* Calculate working area: */
    159163    QRect workingArea = vboxGlobal().availableGeometry(iScreen);
     164
    160165    /* Move to the appropriate position: */
    161166    move(workingArea.topLeft());
     167
    162168    /* Resize to the appropriate size: */
    163169    resize(workingArea.size());
     170}
     171
     172void UIMachineWindowSeamless::showInNecessaryMode()
     173{
     174    /* Make sure this window has seamless logic: */
     175    UIMachineLogicSeamless *pSeamlessLogic = qobject_cast<UIMachineLogicSeamless*>(machineLogic());
     176    AssertPtrReturnVoid(pSeamlessLogic);
     177
     178    /* Make sure this window should be shown and mapped to some host-screen: */
     179    if (!uisession()->isScreenVisible(m_uScreenId) ||
     180        !pSeamlessLogic->hasHostScreenForGuestScreen(m_uScreenId))
     181    {
     182#ifndef Q_WS_MAC
     183        /* Hide mini-toolbar: */
     184        if (m_pMiniToolBar)
     185            m_pMiniToolBar->hide();
     186#endif /* !Q_WS_MAC */
     187        /* Hide window: */
     188        hide();
     189        return;
     190    }
     191
     192    /* Make sure this window is not minimized: */
     193    if (isMinimized())
     194        return;
     195
     196    /* Make sure this window is maximized and placed on valid screen: */
     197    placeOnScreen();
     198
     199    /* Show in normal mode: */
     200    show();
     201
    164202    /* Adjust guest screen size if necessary: */
    165203    machineView()->maybeAdjustGuestScreenSize();
    166 #ifndef Q_WS_MAC
    167     /* Move mini-toolbar into appropriate place: */
     204
     205#ifndef Q_WS_MAC
     206    /* Show/Move mini-toolbar into appropriate place: */
    168207    if (m_pMiniToolBar)
     208    {
     209        m_pMiniToolBar->show();
    169210        m_pMiniToolBar->adjustGeometry();
    170 #endif /* !Q_WS_MAC */
    171 }
    172 
    173 void UIMachineWindowSeamless::showInNecessaryMode()
    174 {
    175     /* Make sure this window should be shown at all: */
    176     if (!uisession()->isScreenVisible(m_uScreenId))
    177         return hide();
    178 
    179     /* Make sure this window has seamless logic: */
    180     UIMachineLogicSeamless *pSeamlessLogic = qobject_cast<UIMachineLogicSeamless*>(machineLogic());
    181     if (!pSeamlessLogic)
    182         return hide();
    183 
    184     /* Make sure this window mapped to some host-screen: */
    185     if (!pSeamlessLogic->hasHostScreenForGuestScreen(m_uScreenId))
    186         return hide();
    187 
    188     /* Make sure this window is not minimized: */
    189     if (isMinimized())
    190         return;
    191 
    192     /* Make sure this window is maximized and placed on valid screen: */
    193     placeOnScreen();
    194 
    195     /* Show in normal mode: */
    196     show();
     211    }
     212#endif /* !Q_WS_MAC */
    197213}
    198214
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