Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp	(revision 41486)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp	(revision 41487)
@@ -163,8 +163,11 @@
     /* Process KGuestMonitorChangedEventType_Enabled change event: */
     if (isHidden() && changeType == KGuestMonitorChangedEventType_Enabled)
-        showInNecessaryMode();
+        uisession()->setScreenVisible(m_uScreenId, true);
     /* Process KGuestMonitorChangedEventType_Disabled change event: */
     else if (!isHidden() && changeType == KGuestMonitorChangedEventType_Disabled)
-        hide();
+        uisession()->setScreenVisible(m_uScreenId, false);
+
+    /* Update screen visibility status: */
+    showInNecessaryMode();
 }
 
@@ -612,30 +615,4 @@
 #endif /* VBOX_WITH_DEBUGGER_GUI */
 
-bool UIMachineWindow::shouldWeShowWindow() const
-{
-    /* By default, every window should be shown: */
-    bool fResult = true;
-    /* But if machine is 'turned off': */
-    if (uisession()->isTurnedOff())
-    {
-        /* If machine is in 'saved' state: */
-        if (uisession()->isSaved())
-        {
-            /* We are getting shown-state from saved-state: */
-            BOOL fEnabled = true;
-            ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
-            machine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
-            fResult = fEnabled;
-        }
-        /* If machine is in 'powered off', 'teleported' or 'aborted' state: */
-        else
-        {
-            /* Shown-state is 'enabled' only for 1st monitor: */
-            fResult = m_uScreenId == 0;
-        }
-    }
-    return fResult;
-}
-
 /* static */
 Qt::WindowFlags UIMachineWindow::windowFlags(UIVisualStateType visualStateType)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h	(revision 41486)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h	(revision 41487)
@@ -109,5 +109,4 @@
 
     /* Helpers: */
-    bool shouldWeShowWindow() const;
     const QString& defaultWindowTitle() const { return m_strWindowTitlePrefix; }
     static Qt::WindowFlags windowFlags(UIVisualStateType visualStateType);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 41486)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 41487)
@@ -92,4 +92,7 @@
     prepareConsoleEventHandlers();
 
+    /* Prepare screens: */
+    prepareScreens();
+
     /* Prepare framebuffers: */
     prepareFramebuffers();
@@ -655,4 +658,28 @@
 }
 
+void UISession::prepareScreens()
+{
+    /* Get machine: */
+    CMachine machine = m_session.GetMachine();
+
+    /* Prepare initial screen visibility status: */
+    m_monitorVisibilityVector.resize(machine.GetMonitorCount());
+    m_monitorVisibilityVector.fill(false);
+    m_monitorVisibilityVector[0] = true;
+
+    /* If machine is in 'saved' state: */
+    if (isSaved())
+    {
+        /* Update screen visibility status from saved-state: */
+        for (int i = 0; i < m_monitorVisibilityVector.size(); ++i)
+        {
+            BOOL fEnabled = true;
+            ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
+            machine.QuerySavedGuestScreenInfo(i, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
+            m_monitorVisibilityVector[i] = fEnabled;
+        }
+    }
+}
+
 void UISession::prepareFramebuffers()
 {
@@ -1073,4 +1100,17 @@
 }
 
+bool UISession::isScreenVisible(ulong uScreenId) const
+{
+    Assert(uScreenId < (ulong)m_monitorVisibilityVector.size());
+    return m_monitorVisibilityVector.value((int)uScreenId, false);
+}
+
+void UISession::setScreenVisible(ulong uScreenId, bool fIsMonitorVisible)
+{
+    Assert(uScreenId < (ulong)m_monitorVisibilityVector.size());
+    if (uScreenId < (ulong)m_monitorVisibilityVector.size())
+        m_monitorVisibilityVector[(int)uScreenId] = fIsMonitorVisible;
+}
+
 UIFrameBuffer* UISession::frameBuffer(ulong uScreenId) const
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 41486)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 41487)
@@ -147,4 +147,8 @@
     void setMouseIntegrated(bool fIsMouseIntegrated) { m_fIsMouseIntegrated = fIsMouseIntegrated; }
 
+    /* Screen visibility status: */
+    bool isScreenVisible(ulong uScreenId) const;
+    void setScreenVisible(ulong uScreenId, bool fIsMonitorVisible);
+
     /* Returns existing framebuffer for the given screen-number;
      * Returns 0 (asserts) if screen-number attribute is out of bounds: */
@@ -202,4 +206,5 @@
     /* Prepare helpers: */
     void prepareConsoleEventHandlers();
+    void prepareScreens();
     void prepareFramebuffers();
     void prepareMenuPool();
@@ -210,4 +215,5 @@
     void cleanupMenuPool();
     void cleanupFramebuffers();
+    //void cleanupSession() {}
     void cleanupConsoleEventHandlers();
 
@@ -227,4 +233,7 @@
 
     UIMachineMenuBar *m_pMenuPool;
+
+    /* Screen visibility vector: */
+    QVector<bool> m_monitorVisibilityVector;
 
     /* Frame-buffers vector: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 41486)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 41487)
@@ -166,5 +166,5 @@
 {
     /* Show window if we have to: */
-    if (shouldWeShowWindow())
+    if (uisession()->isScreenVisible(m_uScreenId))
     {
         /* Make sure the window is placed on valid screen
@@ -186,4 +186,6 @@
 #endif /* Q_WS_MAC */
     }
+    /* Else hide window: */
+    else hide();
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp	(revision 41486)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp	(revision 41487)
@@ -506,6 +506,9 @@
 {
     /* Show window if we have to: */
-    if (shouldWeShowWindow())
+    if (uisession()->isScreenVisible(m_uScreenId))
         show();
+    /* Else hide window: */
+    else
+        hide();
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp	(revision 41486)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp	(revision 41487)
@@ -200,6 +200,9 @@
 {
     /* Show window if we have to: */
-    if (shouldWeShowWindow())
+    if (uisession()->isScreenVisible(m_uScreenId))
         show();
+    /* Else hide window: */
+    else
+        hide();
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp	(revision 41486)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp	(revision 41487)
@@ -220,5 +220,5 @@
 {
     /* Show window if we have to: */
-    if (shouldWeShowWindow())
+    if (uisession()->isScreenVisible(m_uScreenId))
     {
         /* Show manually maximized window: */
@@ -235,4 +235,6 @@
 #endif /* Q_WS_MAC */
     }
+    /* Else hide window: */
+    else hide();
 }
 
