Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 61658)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 61659)
@@ -60,39 +60,6 @@
     , m_fIsInFullscreenTransition(false)
 #endif /* VBOX_WS_MAC */
-{
-}
-
-void UIMachineWindowFullscreen::changeEvent(QEvent *pChangeEvent)
-{
-    /* Overriding changeEvent for controlling mini-tool bar visibilty.
-     * Hiding tool-bar when machine-window is minimized and show it in full-screen: */
-#if defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
-    if (pChangeEvent->type() == QEvent::WindowStateChange)
-    {
-        /* If machine-window is in minimized mode: */
-        if (isMinimized())
-        {
-            /* If there is a mini-toolbar: */
-            if (m_pMiniToolBar)
-            {
-                /* Hide mini-toolbar: */
-                m_pMiniToolBar->hide();
-            }
-        }
-        /* If machine-window is in full-screen mode: */
-        else
-        {
-            /* If there is a mini-toolbar: */
-            if (m_pMiniToolBar)
-            {
-                /* Show mini-toolbar in full-screen mode: */
-                m_pMiniToolBar->showFullScreen();
-            }
-        }
-    }
-#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
-
-    /* Call to base-class: */
-    UIMachineWindow::changeEvent(pChangeEvent);
+    , m_fWasMinimized(false)
+{
 }
 
@@ -451,6 +418,17 @@
         !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
     {
-        /* Hide window: */
+        /* Remember whether the window was minimized: */
+        if (isMinimized())
+            m_fWasMinimized = true;
+        /* Hide window and reset it's state to NONE: */
+        setWindowState(Qt::WindowNoState);
         hide();
+        /* If there is mini-toolbar: */
+        if (m_pMiniToolBar)
+        {
+            /* Hide mini-toolbar and reset it's state to NONE: */
+            m_pMiniToolBar->setWindowState(Qt::WindowNoState);
+            m_pMiniToolBar->hide();
+        }
     }
     else
@@ -489,14 +467,17 @@
         }
 #elif defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
-        /* If machine-window is in minimized mode: */
-        if (isMinimized())
-        {
-            /* Show window in minimized mode: */
+        /* If there is mini-toolbar: */
+        if (m_pMiniToolBar)
+        {
+            /* Show mini-toolbar: */
+            m_pMiniToolBar->showFullScreen();
+        }
+        /* Show window: */
+        showFullScreen();
+        /* Restore minimized state if necessary: */
+        if (m_fWasMinimized)
+        {
+            m_fWasMinimized = false;
             showMinimized();
-        }
-        else
-        {
-            /* Show window in fullscreen mode: */
-            showFullScreen();
         }
 #endif /* VBOX_WS_WIN || VBOX_WS_X11 */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h	(revision 61658)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h	(revision 61659)
@@ -51,7 +51,4 @@
     /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
     UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId);
-
-    /** Handles Qt @a pChangeEvent. */
-    void changeEvent(QEvent *pChangeEvent);
 
 #ifdef VBOX_WS_MAC
@@ -124,4 +121,8 @@
 #endif /* VBOX_WS_MAC */
 
+    /** Holds whether the window was minimized before became hidden.
+      * Used to restore minimized state when the window shown again. */
+    bool m_fWasMinimized;
+
     /** Factory support. */
     friend class UIMachineWindow;
