VirtualBox

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


Ignore:
Timestamp:
Jun 3, 2016 9:25:38 AM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8387: Runtime UI: Full-screen: Fix for loosing screens and mini-toolbar visibility when windows are minimized.

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

Legend:

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

    r60362 r61430  
    5656#endif /* VBOX_WS_MAC */
    5757{
     58}
     59
     60void UIMachineWindowFullscreen::changeEvent(QEvent *pChangeEvent)
     61{
     62    /* Overriding changeEvent for controlling mini-tool bar visibilty.
     63     * Hiding tool-bar when machine-window is minimized and show it in full-screen: */
     64#if defined(Q_WS_WIN) || defined(Q_WS_X11)
     65    if (pChangeEvent->type() == QEvent::WindowStateChange)
     66    {
     67        /* If machine-window is in minimized mode: */
     68        if(isMinimized())
     69        {
     70            /* If there is a mini-toolbar: */
     71            if (m_pMiniToolBar)
     72            {
     73                /* Hide mini-toolbar: */
     74                m_pMiniToolBar->hide();
     75            }
     76        }
     77        /* If machine-window is in full-screen mode: */
     78        else
     79        {
     80            /* If there is a mini-toolbar: */
     81            if (m_pMiniToolBar)
     82            {
     83                /* Show mini-toolbar in full-screen mode: */
     84                m_pMiniToolBar->showFullScreen();
     85            }
     86        }
     87    }
     88#endif /* Q_WS_WIN || Q_WS_X11 */
     89
     90    /* Call to base-class: */
     91    QMainWindow::changeEvent(pChangeEvent);
    5892}
    5993
     
    375409        !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
    376410    {
    377 #if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
    378         /* If there is a mini-toolbar: */
    379         if (m_pMiniToolBar)
    380         {
    381             /* Hide mini-toolbar: */
    382             m_pMiniToolBar->hide();
    383         }
    384 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */
    385 
    386411        /* Hide window: */
    387412        hide();
     
    389414    else
    390415    {
    391         /* Ignore if window minimized: */
    392         if (isMinimized())
     416        /* Ignore if window is minimized and visible: */
     417        if (isMinimized() && isVisible())
    393418            return;
    394419
     
    422447        }
    423448#elif defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
    424         /* Show window in fullscreen mode: */
    425         showFullScreen();
    426 
    427         /* If there is a mini-toolbar: */
    428         if (m_pMiniToolBar)
    429         {
    430             /* Show mini-toolbar in full-screen mode: */
    431             m_pMiniToolBar->showFullScreen();
     449        /* If machine-window is in minimized mode: */
     450        if (isMinimized())
     451        {
     452            /* Show window in minimized mode: */
     453            showMinimized();
     454        }
     455        else
     456        {
     457            /* Show window in fullscreen mode: */
     458            showFullScreen();
    432459        }
    433460#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r60362 r61430  
    5151    /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
    5252    UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId);
     53
     54    /** Handles Qt change @a pChangeEvent. */
     55    void changeEvent(QEvent *pChangeEvent);
    5356
    5457#ifdef VBOX_WS_MAC
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