Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp	(revision 41051)
@@ -39,4 +39,5 @@
     qRegisterMetaType<CUSBDevice>("CUSBDevice");
     qRegisterMetaType<CVirtualBoxErrorInfo>("CVirtualBoxErrorInfo");
+    qRegisterMetaType<KGuestMonitorChangedEventType>("KGuestMonitorChangedEventType");
 }
 
@@ -225,4 +226,11 @@
             break;
         }
+        case KVBoxEventType_OnGuestMonitorChanged:
+        {
+            CGuestMonitorChangedEvent es(pEvent);
+            emit sigGuestMonitorChange(es.GetChangeType(), es.GetScreenId(),
+                                       QRect(es.GetOriginX(), es.GetOriginY(), es.GetWidth(), es.GetHeight()));
+            break;
+        }
         default: break;
     }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h	(revision 41051)
@@ -76,4 +76,5 @@
     void sigShowWindow(LONG64 &winId); /* use Qt::DirectConnection */
     void sigCPUExecutionCapChange();
+    void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp	(revision 41051)
@@ -80,5 +80,6 @@
         << KVBoxEventType_OnCanShowWindow
         << KVBoxEventType_OnShowWindow
-        << KVBoxEventType_OnCPUExecutionCapChanged;
+        << KVBoxEventType_OnCPUExecutionCapChanged
+        << KVBoxEventType_OnGuestMonitorChanged;
 
     const CConsole &console = m_pSession->session().GetConsole();
@@ -149,4 +150,8 @@
             this, SIGNAL(sigCPUExecutionCapChange()),
             Qt::QueuedConnection);
+
+    connect(pListener->getWrapped(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)),
+            this, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)),
+            Qt::QueuedConnection);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h	(revision 41051)
@@ -51,4 +51,5 @@
 #endif /* RT_OS_DARWIN */
     void sigCPUExecutionCapChange();
+    void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
 
 private slots:
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp	(revision 41051)
@@ -446,4 +446,8 @@
     /* Machine state-change updater: */
     QObject::connect(uisession(), SIGNAL(sigMachineStateChange()), machineWindow(), SLOT(sltMachineStateChanged()));
+
+    /* Guest monitor change updater: */
+    QObject::connect(uisession(), SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)),
+                     machineWindow(), SLOT(sltGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)));
 }
 
@@ -531,2 +535,20 @@
 }
 
+void UIMachineWindow::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect /* screenGeo */)
+{
+    /* Ignore change events for other screens: */
+    if (uScreenId != m_uScreenId)
+        return;
+
+    /* Ignore KGuestMonitorChangedEventType_NewOrigin change event: */
+    if (changeType == KGuestMonitorChangedEventType_NewOrigin)
+        return;
+
+    /* Process KGuestMonitorChangedEventType_Enabled change event: */
+    if (machineWindow()->isHidden() && changeType == KGuestMonitorChangedEventType_Enabled)
+        showInNecessaryMode();
+    /* Process KGuestMonitorChangedEventType_Disabled change event: */
+    else if (!machineWindow()->isHidden() && changeType == KGuestMonitorChangedEventType_Disabled)
+        machineWindow()->hide();
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h	(revision 41051)
@@ -22,4 +22,5 @@
 /* Local includes */
 #include "UIMachineDefs.h"
+#include "COMDefs.h"
 
 /* Global forwards */
@@ -97,4 +98,8 @@
     /* Protected slots: */
     virtual void sltMachineStateChanged();
+    virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
+
+    /* Show routine: */
+    virtual void showInNecessaryMode() = 0;
 
     /* Protected variables: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 41051)
@@ -138,4 +138,7 @@
             this, SIGNAL(sigCPUExecutionCapChange()));
 
+    connect(gConsoleEvents, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)),
+            this, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)));
+
     /* Prepare framebuffers: */
     prepareFramebuffers();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 41051)
@@ -173,4 +173,5 @@
 #endif /* RT_OS_DARWIN */
     void sigCPUExecutionCapChange();
+    void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
 
     /* Session signals: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 41051)
@@ -75,21 +75,6 @@
     updateAppearanceOf(UIVisualElement_AllStuff);
 
-    /* Make sure the window is placed on valid screen
-     * before we are show fullscreen window: */
-    sltPlaceOnScreen();
-
     /* Show fullscreen window: */
-    showFullScreen();
-
-    /* Make sure the window is placed on valid screen again
-     * after window is shown & window's decorations applied.
-     * That is required due to X11 Window Geometry Rules. */
-    sltPlaceOnScreen();
-
-#ifdef Q_WS_MAC
-    /* Make sure it is really on the right place (especially on the Mac) */
-    QRect r = QApplication::desktop()->screenGeometry(static_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId));
-    move(r.topLeft());
-#endif /* Q_WS_MAC */
+    showInNecessaryMode();
 }
 
@@ -129,4 +114,9 @@
 {
     UIMachineWindow::sltMachineStateChanged();
+}
+
+void UIMachineWindowFullscreen::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
+{
+    UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
 }
 
@@ -293,2 +283,30 @@
 }
 
+void UIMachineWindowFullscreen::showInNecessaryMode()
+{
+    /* Make sure we really have to show window: */
+    BOOL fEnabled = true;
+    ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
+    session().GetMachine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
+    if (fEnabled)
+    {
+        /* Make sure the window is placed on valid screen
+         * before we are show fullscreen window: */
+        sltPlaceOnScreen();
+
+        /* Show window fullscreen: */
+        showFullScreen();
+
+        /* Make sure the window is placed on valid screen again
+         * after window is shown & window's decorations applied.
+         * That is required due to X11 Window Geometry Rules. */
+        sltPlaceOnScreen();
+
+#ifdef Q_WS_MAC
+        /* Make sure it is really on the right place (especially on the Mac): */
+        QRect r = QApplication::desktop()->screenGeometry(static_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId));
+        move(r.topLeft());
+#endif /* Q_WS_MAC */
+    }
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h	(revision 41051)
@@ -48,4 +48,5 @@
     /* Console callback handlers: */
     void sltMachineStateChanged();
+    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
 
     /* Popup main menu: */
@@ -81,4 +82,7 @@
     void updateAppearanceOf(int iElement);
 
+    /* Other members: */
+    void showInNecessaryMode();
+
     /* Private variables: */
     QMenu *m_pMainMenu;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp	(revision 41051)
@@ -104,6 +104,6 @@
 #endif /* Q_WS_MAC */
 
-    /* Show window: */
-    showSimple();
+    /* Show normal window: */
+    showInNecessaryMode();
 }
 
@@ -163,4 +163,9 @@
 {
     updateAppearanceOf(UIVisualElement_VirtualizationStuff);
+}
+
+void UIMachineWindowNormal::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
+{
+    UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
 }
 
@@ -370,5 +375,4 @@
     connect(machineLogic()->uisession(), SIGNAL(sigCPUExecutionCapChange()),
             this, SLOT(sltCPUExecutionCapChange()));
-
 }
 
@@ -672,8 +676,12 @@
 }
 
-void UIMachineWindowNormal::showSimple()
-{
-    /* Just show window: */
-    show();
+void UIMachineWindowNormal::showInNecessaryMode()
+{
+    /* Make sure we really have to show window: */
+    BOOL fEnabled = true;
+    ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
+    session().GetMachine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
+    if (fEnabled)
+        show();
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h	(revision 41051)
@@ -27,5 +27,4 @@
 #include "QIWithRetranslateUI.h"
 #include "UIMachineWindow.h"
-#include "COMDefs.h"
 #include "UINetworkDefs.h"
 
@@ -55,4 +54,5 @@
     void sltSharedFolderChange();
     void sltCPUExecutionCapChange();
+    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
 
     /* LED connections: */
@@ -104,5 +104,5 @@
 
     /* Other members: */
-    void showSimple();
+    void showInNecessaryMode();
     bool isMaximizedChecked();
     void updateIndicatorState(QIStateIndicator *pIndicator, KDeviceType deviceType);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp	(revision 41051)
@@ -87,6 +87,6 @@
 #endif /* Q_WS_MAC */
 
-    /* Show window: */
-    showSimple();
+    /* Show scaled window: */
+    showInNecessaryMode();
 }
 
@@ -111,4 +111,9 @@
 {
     UIMachineWindow::sltMachineStateChanged();
+}
+
+void UIMachineWindowScale::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
+{
+    UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
 }
 
@@ -360,8 +365,12 @@
 }
 
-void UIMachineWindowScale::showSimple()
-{
-    /* Just show window: */
-    show();
+void UIMachineWindowScale::showInNecessaryMode()
+{
+    /* Make sure we really have to show window: */
+    BOOL fEnabled = true;
+    ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
+    session().GetMachine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
+    if (fEnabled)
+        show();
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h	(revision 41051)
@@ -41,4 +41,5 @@
     /* Console callback handlers: */
     void sltMachineStateChanged();
+    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
 
     /* Popup main menu: */
@@ -76,5 +77,5 @@
 
     /* Other members: */
-    void showSimple();
+    void showInNecessaryMode();
     bool isMaximizedChecked();
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp	(revision 41051)
@@ -93,6 +93,6 @@
     updateAppearanceOf(UIVisualElement_AllStuff);
 
-    /* Show window: */
-    showSeamless();
+    /* Show seamless window: */
+    showInNecessaryMode();
 }
 
@@ -134,4 +134,9 @@
 {
     UIMachineWindow::sltMachineStateChanged();
+}
+
+void UIMachineWindowSeamless::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
+{
+    UIMachineWindow::sltGuestMonitorChange(changeType, uScreenId, screenGeo);
 }
 
@@ -359,16 +364,25 @@
 }
 
-void UIMachineWindowSeamless::showSeamless()
-{
-    /* Show manually maximized window: */
-    sltPlaceOnScreen();
-    show();
-
-#ifdef Q_WS_MAC
-    /* Make sure it is really on the right place (especially on the Mac): */
-    int iScreen = static_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId);
-    QRect r = vboxGlobal().availableGeometry(iScreen);
-    move(r.topLeft());
-#endif /* Q_WS_MAC */
+void UIMachineWindowSeamless::showInNecessaryMode()
+{
+    /* Make sure we really have to show window: */
+    BOOL fEnabled = true;
+    ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0;
+    session().GetMachine().QuerySavedGuestScreenInfo(m_uScreenId, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);
+    if (fEnabled)
+    {
+        /* Show manually maximized window: */
+        sltPlaceOnScreen();
+
+        /* Show normal window: */
+        show();
+
+#ifdef Q_WS_MAC
+        /* Make sure it is really on the right place (especially on the Mac): */
+        int iScreen = static_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId);
+        QRect r = vboxGlobal().availableGeometry(iScreen);
+        move(r.topLeft());
+#endif /* Q_WS_MAC */
+    }
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h	(revision 41050)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h	(revision 41051)
@@ -48,4 +48,5 @@
     /* Console callback handlers: */
     void sltMachineStateChanged();
+    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
 
     /* Popup main menu: */
@@ -98,5 +99,5 @@
 
     /* Other members: */
-    void showSeamless();
+    void showInNecessaryMode();
     void setMask(const QRegion &region);
 
