Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 98404)
@@ -46,4 +46,5 @@
 #include "UIMachineWindow.h"
 #include "UIMessageCenter.h"
+#include "UINotificationCenter.h"
 #ifdef VBOX_WS_MAC
 # include "UICocoaApplication.h"
@@ -362,8 +363,88 @@
 }
 
+void UIMachine::detachUi()
+{
+    /* Manually close Runtime UI: */
+    LogRel(("GUI: Detaching UI..\n"));
+    closeRuntimeUI();
+}
+
+void UIMachine::saveState()
+{
+    /* Prepare VM to be saved: */
+    if (!uisession()->prepareToBeSaved())
+        return;
+
+    /* Enable 'manual-override',
+     * preventing automatic Runtime UI closing: */
+    setManualOverrideMode(true);
+
+    /* Now, do the magic: */
+    LogRel(("GUI: Saving VM state..\n"));
+    UINotificationProgressMachineSaveState *pNotification =
+        new UINotificationProgressMachineSaveState(uisession()->machine());
+    connect(pNotification, &UINotificationProgressMachineSaveState::sigMachineStateSaved,
+            this, &UIMachine::sltHandleMachineStateSaved);
+    gpNotificationCenter->append(pNotification);
+}
+
+void UIMachine::shutdown()
+{
+    /* Prepare VM to be shutdowned: */
+    if (!uisession()->prepareToBeShutdowned())
+        return;
+
+    /* Now, do the magic: */
+    LogRel(("GUI: Sending ACPI shutdown signal..\n"));
+    CConsole comConsole = uisession()->console();
+    comConsole.PowerButton();
+    if (!comConsole.isOk())
+        UINotificationMessage::cannotACPIShutdownMachine(uisession()->console());
+}
+
+void UIMachine::powerOff(bool fIncludingDiscard)
+{
+    /* Enable 'manual-override',
+     * preventing automatic Runtime UI closing: */
+    setManualOverrideMode(true);
+
+    /* Now, do the magic: */
+    LogRel(("GUI: Powering VM off..\n"));
+    UINotificationProgressMachinePowerOff *pNotification =
+        new UINotificationProgressMachinePowerOff(uisession()->machine(),
+                                                  uisession()->console(),
+                                                  fIncludingDiscard);
+    connect(pNotification, &UINotificationProgressMachinePowerOff::sigMachinePoweredOff,
+            this, &UIMachine::sltHandleMachinePoweredOff);
+    gpNotificationCenter->append(pNotification);
+}
+
 void UIMachine::closeRuntimeUI()
 {
-    /* Quit application: */
-    QApplication::quit();
+    /* First, we have to hide any opened modal/popup widgets.
+     * They then should unlock their event-loops asynchronously.
+     * If all such loops are unlocked, we can close Runtime UI. */
+    QWidget *pWidget = QApplication::activeModalWidget()
+                     ? QApplication::activeModalWidget()
+                     : QApplication::activePopupWidget()
+                     ? QApplication::activePopupWidget()
+                     : 0;
+    if (pWidget)
+    {
+        /* First we should try to close this widget: */
+        pWidget->close();
+        /* If widget rejected the 'close-event' we can
+         * still hide it and hope it will behave correctly
+         * and unlock his event-loop if any: */
+        if (!pWidget->isHidden())
+            pWidget->hide();
+        /* Asynchronously restart this slot: */
+        QMetaObject::invokeMethod(this, "closeRuntimeUI", Qt::QueuedConnection);
+        return;
+    }
+
+    /* Asynchronously ask QApplication to quit: */
+    LogRel(("GUI: Request for async QApp quit.\n"));
+    QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection);
 }
 
@@ -675,4 +756,42 @@
         emit sigCursorPositionChange();
     }
+}
+
+void UIMachine::sltHandleMachineStateSaved(bool fSuccess)
+{
+    /* Disable 'manual-override' finally: */
+    setManualOverrideMode(false);
+
+    /* Close Runtime UI if state was saved: */
+    if (fSuccess)
+        closeRuntimeUI();
+}
+
+void UIMachine::sltHandleMachinePoweredOff(bool fSuccess, bool fIncludingDiscard)
+{
+    /* Disable 'manual-override' finally: */
+    setManualOverrideMode(false);
+
+    /* Do we have other tasks? */
+    if (fSuccess)
+    {
+        if (fIncludingDiscard)
+        {
+            /* Now, do more magic! */
+            UINotificationProgressSnapshotRestore *pNotification =
+                new UINotificationProgressSnapshotRestore(uiCommon().managedVMUuid());
+            connect(pNotification, &UINotificationProgressSnapshotRestore::sigSnapshotRestored,
+                    this, &UIMachine::sltHandleSnapshotRestored);
+            gpNotificationCenter->append(pNotification);
+        }
+        else
+            closeRuntimeUI();
+    }
+}
+
+void UIMachine::sltHandleSnapshotRestored(bool)
+{
+    /* Close Runtime UI independent of snapshot restoring state: */
+    closeRuntimeUI();
 }
 
@@ -711,4 +830,5 @@
     , m_fIsMouseIntegrated(true)
     , m_iMouseState(0)
+    , m_fIsManualOverride(false)
     , m_defaultCloseAction(MachineCloseAction_Invalid)
     , m_restrictedCloseActions(MachineCloseAction_Invalid)
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h	(revision 98404)
@@ -298,8 +298,24 @@
     /** @name Close stuff.
      * @{ */
+        /** Returns whether VM is in 'manual-override' mode.
+          * @note S.a. #m_fIsManualOverride description for more information. */
+        bool isManualOverrideMode() const { return m_fIsManualOverride; }
+        /** Defines whether VM is in 'manual-override' mode.
+          * @note S.a. #m_fIsManualOverride description for more information. */
+        void setManualOverrideMode(bool fIsManualOverride) { m_fIsManualOverride = fIsManualOverride; }
+
         /** Returns default close action. */
         MachineCloseAction defaultCloseAction() const { return m_defaultCloseAction; }
         /** Returns merged restricted close actions. */
         MachineCloseAction restrictedCloseActions() const { return m_restrictedCloseActions; }
+
+        /** Detaches and closes Runtime UI. */
+        void detachUi();
+        /** Saves VM state, then closes Runtime UI. */
+        void saveState();
+        /** Calls for guest shutdown to close Runtime UI. */
+        void shutdown();
+        /** Powers VM off, then closes Runtime UI. */
+        void powerOff(bool fIncludingDiscard);
     /** @} */
 
@@ -414,4 +430,18 @@
     /** @} */
 
+    /** @name Close stuff.
+     * @{ */
+        /** Handles signal about machine state saved.
+          * @param  fSuccess  Brings whether state was saved successfully. */
+        void sltHandleMachineStateSaved(bool fSuccess);
+        /** Handles signal about machine powered off.
+          * @param  fSuccess           Brings whether machine was powered off successfully.
+          * @param  fIncludingDiscard  Brings whether machine state should be discarded. */
+        void sltHandleMachinePoweredOff(bool fSuccess, bool fIncludingDiscard);
+        /** Handles signal about snapshot restored.
+          * @param  fSuccess  Brings whether machine was powered off successfully. */
+        void sltHandleSnapshotRestored(bool fSuccess);
+    /** @} */
+
 private:
 
@@ -629,4 +659,9 @@
     /** @name Close stuff.
      * @{ */
+        /** Holds whether VM is in 'manual-override' mode
+          * which means there will be no automatic UI shutdowns,
+          * visual representation mode changes and other stuff. */
+        bool  m_fIsManualOverride : 1;
+
         /** Default close action. */
         MachineCloseAction  m_defaultCloseAction;
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 98404)
@@ -417,5 +417,5 @@
     /* Power VM off: */
     LogRel(("GUI: Request to power VM off due to VBoxSVC is unavailable.\n"));
-    uisession()->powerOff(false /* do NOT restore current snapshot */);
+    uimachine()->powerOff(false /* do NOT restore current snapshot */);
 }
 
@@ -473,5 +473,5 @@
                     {
                         LogRel(("GUI: User requested to power VM off on Guru Meditation.\n"));
-                        uisession()->powerOff(false /* do NOT restore current snapshot */);
+                        uimachine()->powerOff(false /* do NOT restore current snapshot */);
                     }
                     break;
@@ -481,5 +481,5 @@
                 {
                     LogRel(("GUI: Automatic request to power VM off on Guru Meditation.\n"));
-                    uisession()->powerOff(false /* do NOT restore current snapshot */);
+                    uimachine()->powerOff(false /* do NOT restore current snapshot */);
                     break;
                 }
@@ -525,5 +525,5 @@
         {
             /* If not in 'manual-override' mode: */
-            if (!uisession()->isManualOverrideMode())
+            if (!uimachine()->isManualOverrideMode())
             {
                 /* VM has been powered off, saved, teleported or aborted.
@@ -549,5 +549,5 @@
 
                 LogRel(("GUI: Request to close Runtime UI because VM is powered off already.\n"));
-                uisession()->closeRuntimeUI();
+                uimachine()->closeRuntimeUI();
                 return;
             }
@@ -997,7 +997,7 @@
     /* 'Application' actions connection: */
     connect(actionPool()->action(UIActionIndex_M_Application_S_Preferences), &UIAction::triggered,
-            this, &UIMachineLogic::sltOpenPreferencesDialogDefault, Qt::UniqueConnection);
+            this, &UIMachineLogic::sltOpenPreferencesDialogDefault);
     connect(actionPool()->action(UIActionIndex_M_Application_S_Close), &UIAction::triggered,
-            this, &UIMachineLogic::sltClose, Qt::QueuedConnection);
+            this, &UIMachineLogic::sltClose);
 
     /* 'Machine' actions connections: */
@@ -1535,5 +1535,5 @@
         return;
     /* Do not close machine-window in 'manual-override' mode: */
-    if (uisession()->isManualOverrideMode())
+    if (uimachine()->isManualOverrideMode())
         return;
 
@@ -1755,5 +1755,5 @@
 
     LogRel(("GUI: User requested to detach GUI.\n"));
-    uisession()->detachUi();
+    uimachine()->detachUi();
 }
 
@@ -1768,5 +1768,5 @@
 
     LogRel(("GUI: User requested to save VM state.\n"));
-    uisession()->saveState();
+    uimachine()->saveState();
 }
 
@@ -1781,5 +1781,5 @@
 
     LogRel(("GUI: User requested to shutdown VM.\n"));
-    uisession()->shutdown();
+    uimachine()->shutdown();
 }
 
@@ -1795,5 +1795,5 @@
     LogRel(("GUI: User requested to power VM off.\n"));
     const bool fDiscardStateOnPowerOff = gEDataManager->discardStateOnPowerOff(uiCommon().managedVMUuid());
-    uisession()->powerOff(machine().GetSnapshotCount() > 0 && fDiscardStateOnPowerOff);
+    uimachine()->powerOff(machine().GetSnapshotCount() > 0 && fDiscardStateOnPowerOff);
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp	(revision 98404)
@@ -516,5 +516,5 @@
             /* Detach GUI: */
             LogRel(("GUI: Request for close-action to detach GUI.\n"));
-            uisession()->detachUi();
+            uimachine()->detachUi();
             break;
         }
@@ -523,5 +523,5 @@
             /* Save VM state: */
             LogRel(("GUI: Request for close-action to save VM state.\n"));
-            uisession()->saveState();
+            uimachine()->saveState();
             break;
         }
@@ -530,5 +530,5 @@
             /* Shutdown VM: */
             LogRel(("GUI: Request for close-action to shutdown VM.\n"));
-            uisession()->shutdown();
+            uimachine()->shutdown();
             break;
         }
@@ -538,5 +538,5 @@
             LogRel(("GUI: Request for close-action to power VM off.\n"));
             const bool fDiscardStateOnPowerOff = gEDataManager->discardStateOnPowerOff(uiCommon().managedVMUuid());
-            uisession()->powerOff(machine().GetSnapshotCount() > 0 && fDiscardStateOnPowerOff);
+            uimachine()->powerOff(machine().GetSnapshotCount() > 0 && fDiscardStateOnPowerOff);
             break;
         }
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 98404)
@@ -211,5 +211,5 @@
      * preventing automatic Runtime UI closing
      * and visual representation mode changes: */
-    setManualOverrideMode(true);
+    uimachine()->setManualOverrideMode(true);
 
     /* Show "Starting/Restoring" progress dialog: */
@@ -241,65 +241,8 @@
 
     /* Disable 'manual-override' finally: */
-    setManualOverrideMode(false);
+    uimachine()->setManualOverrideMode(false);
 
     /* True by default: */
     return true;
-}
-
-void UISession::detachUi()
-{
-    /* Manually close Runtime UI: */
-    LogRel(("GUI: Detaching UI..\n"));
-    closeRuntimeUI();
-}
-
-void UISession::saveState()
-{
-    /* Prepare VM to be saved: */
-    if (!prepareToBeSaved())
-        return;
-
-    /* Enable 'manual-override',
-     * preventing automatic Runtime UI closing: */
-    setManualOverrideMode(true);
-
-    /* Now, do the magic: */
-    LogRel(("GUI: Saving VM state..\n"));
-    UINotificationProgressMachineSaveState *pNotification =
-        new UINotificationProgressMachineSaveState(machine());
-    connect(pNotification, &UINotificationProgressMachineSaveState::sigMachineStateSaved,
-            this, &UISession::sltHandleMachineStateSaved);
-    gpNotificationCenter->append(pNotification);
-}
-
-void UISession::shutdown()
-{
-    /* Prepare VM to be shutdowned: */
-    if (!prepareToBeShutdowned())
-        return;
-
-    /* Now, do the magic: */
-    LogRel(("GUI: Sending ACPI shutdown signal..\n"));
-    CConsole comConsole = console();
-    comConsole.PowerButton();
-    if (!comConsole.isOk())
-        UINotificationMessage::cannotACPIShutdownMachine(console());
-}
-
-void UISession::powerOff(bool fIncludingDiscard)
-{
-    /* Enable 'manual-override',
-     * preventing automatic Runtime UI closing: */
-    setManualOverrideMode(true);
-
-    /* Now, do the magic: */
-    LogRel(("GUI: Powering VM off..\n"));
-    UINotificationProgressMachinePowerOff *pNotification =
-        new UINotificationProgressMachinePowerOff(machine(),
-                                                  console(),
-                                                  fIncludingDiscard);
-    connect(pNotification, &UINotificationProgressMachinePowerOff::sigMachinePoweredOff,
-            this, &UISession::sltHandleMachinePoweredOff);
-    gpNotificationCenter->append(pNotification);
 }
 
@@ -404,33 +347,4 @@
 }
 
-void UISession::closeRuntimeUI()
-{
-    /* First, we have to hide any opened modal/popup widgets.
-     * They then should unlock their event-loops asynchronously.
-     * If all such loops are unlocked, we can close Runtime UI. */
-    QWidget *pWidget = QApplication::activeModalWidget()
-                     ? QApplication::activeModalWidget()
-                     : QApplication::activePopupWidget()
-                     ? QApplication::activePopupWidget()
-                     : 0;
-    if (pWidget)
-    {
-        /* First we should try to close this widget: */
-        pWidget->close();
-        /* If widget rejected the 'close-event' we can
-         * still hide it and hope it will behave correctly
-         * and unlock his event-loop if any: */
-        if (!pWidget->isHidden())
-            pWidget->hide();
-        /* Asynchronously restart this slot: */
-        QMetaObject::invokeMethod(this, "closeRuntimeUI", Qt::QueuedConnection);
-        return;
-    }
-
-    /* Asynchronously ask UIMachine to close Runtime UI: */
-    LogRel(("GUI: Passing request to close Runtime UI from UI session to UI machine.\n"));
-    QMetaObject::invokeMethod(uimachine(), "closeRuntimeUI", Qt::QueuedConnection);
-}
-
 void UISession::sltDetachCOM()
 {
@@ -454,42 +368,4 @@
         emit sigMachineStateChange();
     }
-}
-
-void UISession::sltHandleMachineStateSaved(bool fSuccess)
-{
-    /* Disable 'manual-override' finally: */
-    setManualOverrideMode(false);
-
-    /* Close Runtime UI if state was saved: */
-    if (fSuccess)
-        closeRuntimeUI();
-}
-
-void UISession::sltHandleMachinePoweredOff(bool fSuccess, bool fIncludingDiscard)
-{
-    /* Disable 'manual-override' finally: */
-    setManualOverrideMode(false);
-
-    /* Do we have other tasks? */
-    if (fSuccess)
-    {
-        if (!fIncludingDiscard)
-            closeRuntimeUI();
-        else
-        {
-            /* Now, do more magic! */
-            UINotificationProgressSnapshotRestore *pNotification =
-                new UINotificationProgressSnapshotRestore(uiCommon().managedVMUuid());
-            connect(pNotification, &UINotificationProgressSnapshotRestore::sigSnapshotRestored,
-                    this, &UISession::sltHandleSnapshotRestored);
-            gpNotificationCenter->append(pNotification);
-        }
-    }
-}
-
-void UISession::sltHandleSnapshotRestored(bool)
-{
-    /* Close Runtime UI independent of snapshot restoring state: */
-    closeRuntimeUI();
 }
 
@@ -537,5 +413,4 @@
     , m_fIsGuestResizeIgnored(false)
     , m_fIsAutoCaptureDisabled(false)
-    , m_fIsManualOverride(false)
     /* Guest additions flags: */
     , m_ulGuestAdditionsRunLevel(0)
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 98404)
@@ -148,12 +148,4 @@
     /** Powers VM up. */
     bool powerUp();
-    /** Detaches and closes Runtime UI. */
-    void detachUi();
-    /** Saves VM state, then closes Runtime UI. */
-    void saveState();
-    /** Calls for guest shutdown to close Runtime UI. */
-    void shutdown();
-    /** Powers VM off, then closes Runtime UI. */
-    void powerOff(bool fIncludingDiscard);
 
     /** Returns the session instance. */
@@ -212,11 +204,4 @@
     bool isAutoCaptureDisabled() const { return m_fIsAutoCaptureDisabled; }
 
-    /** Returns whether VM is in 'manual-override' mode.
-      * @note S.a. #m_fIsManualOverride description for more information. */
-    bool isManualOverrideMode() const { return m_fIsManualOverride; }
-    /** Defines whether VM is in 'manual-override' mode.
-      * @note S.a. #m_fIsManualOverride description for more information. */
-    void setManualOverrideMode(bool fIsManualOverride) { m_fIsManualOverride = fIsManualOverride; }
-
     /* Guest additions state getters: */
     bool isGuestAdditionsActive() const { return (m_ulGuestAdditionsRunLevel > KAdditionsRunLevelType_None); }
@@ -280,7 +265,4 @@
     void sltMountDVDAdHoc(const QString &strSource);
 
-    /** Closes Runtime UI. */
-    void closeRuntimeUI();
-
 private slots:
 
@@ -291,15 +273,4 @@
     void sltStateChange(KMachineState state);
     void sltAdditionsChange();
-
-    /** Handles signal about machine state saved.
-      * @param  fSuccess  Brings whether state was saved successfully. */
-    void sltHandleMachineStateSaved(bool fSuccess);
-    /** Handles signal about machine powered off.
-      * @param  fSuccess           Brings whether machine was powered off successfully.
-      * @param  fIncludingDiscard  Brings whether machine state should be discarded. */
-    void sltHandleMachinePoweredOff(bool fSuccess, bool fIncludingDiscard);
-    /** Handles signal about snapshot restored.
-      * @param  fSuccess  Brings whether machine was powered off successfully. */
-    void sltHandleSnapshotRestored(bool fSuccess);
 
 private:
@@ -372,8 +343,4 @@
     bool m_fIsGuestResizeIgnored : 1;
     bool m_fIsAutoCaptureDisabled : 1;
-    /** Holds whether VM is in 'manual-override' mode
-      * which means there will be no automatic UI shutdowns,
-      * visual representation mode changes and other stuff. */
-    bool m_fIsManualOverride : 1;
 
     /* Guest additions flags: */
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp	(revision 98404)
@@ -30,20 +30,21 @@
 
 /* GUI includes: */
+#include "QIMenu.h"
+#include "UIActionPoolRuntime.h"
 #include "UICommon.h"
 #include "UIDesktopWidgetWatchdog.h"
+#include "UIMachine.h"
+#include "UIMachineLogicFullscreen.h"
+#include "UIMachineView.h"
+#include "UIMachineWindowFullscreen.h"
 #include "UIMessageCenter.h"
+#include "UIMultiScreenLayout.h"
 #include "UISession.h"
-#include "UIActionPoolRuntime.h"
-#include "UIMachineLogicFullscreen.h"
-#include "UIMachineWindowFullscreen.h"
-#include "UIMultiScreenLayout.h"
 #include "UIShortcutPool.h"
-#include "UIMachineView.h"
-#include "QIMenu.h"
 #ifdef VBOX_WS_MAC
 # include "UICocoaApplication.h"
 # include "UIExtraDataManager.h"
+# include "UIFrameBuffer.h"
 # include "VBoxUtils.h"
-# include "UIFrameBuffer.h"
 # include <Carbon/Carbon.h>
 #endif /* VBOX_WS_MAC */
@@ -348,5 +349,5 @@
 
     /* Do not try to change visual-state type in 'manual override' mode: */
-    if (uisession()->isManualOverrideMode())
+    if (uimachine()->isManualOverrideMode())
         return;
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp	(revision 98404)
@@ -32,20 +32,21 @@
 
 /* GUI includes: */
+#include "UIActionPoolRuntime.h"
 #include "UICommon.h"
 #include "UIDesktopWidgetWatchdog.h"
-#include "UIMessageCenter.h"
-#include "UISession.h"
-#include "UIActionPoolRuntime.h"
+#include "UIExtraDataManager.h"
+#include "UIFrameBuffer.h"
+#include "UIMachine.h"
 #include "UIMachineLogicNormal.h"
 #include "UIMachineWindow.h"
 #include "UIMenuBarEditorWindow.h"
+#include "UIMessageCenter.h"
+#include "UISession.h"
 #include "UIStatusBarEditorWindow.h"
-#include "UIExtraDataManager.h"
-#include "UIFrameBuffer.h"
 #ifndef VBOX_WS_MAC
 # include "QIMenu.h"
-#else  /* VBOX_WS_MAC */
+#else
 # include "VBoxUtils.h"
-#endif /* VBOX_WS_MAC */
+#endif
 
 /* COM includes: */
@@ -79,5 +80,5 @@
 
     /* Do not try to change visual-state type in 'manual override' mode: */
-    if (uisession()->isManualOverrideMode())
+    if (uimachine()->isManualOverrideMode())
         return;
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp	(revision 98404)
@@ -32,11 +32,12 @@
 
 /* GUI includes: */
+#include "UIActionPoolRuntime.h"
 #include "UICommon.h"
 #include "UIDesktopWidgetWatchdog.h"
+#include "UIMachine.h"
+#include "UIMachineLogicScale.h"
+#include "UIMachineWindow.h"
 #include "UIMessageCenter.h"
 #include "UISession.h"
-#include "UIActionPoolRuntime.h"
-#include "UIMachineLogicScale.h"
-#include "UIMachineWindow.h"
 #include "UIShortcutPool.h"
 #ifndef VBOX_WS_MAC
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp	(revision 98403)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp	(revision 98404)
@@ -32,17 +32,18 @@
 
 /* GUI includes: */
+#include "UIActionPoolRuntime.h"
 #include "UICommon.h"
-#include "UIMessageCenter.h"
-#include "UISession.h"
-#include "UIActionPoolRuntime.h"
+#include "UIMachine.h"
 #include "UIMachineLogicSeamless.h"
 #include "UIMachineWindowSeamless.h"
+#include "UIMessageCenter.h"
 #include "UIMultiScreenLayout.h"
+#include "UISession.h"
 #include "UIShortcutPool.h"
 #ifndef VBOX_WS_MAC
 # include "QIMenu.h"
-#else  /* VBOX_WS_MAC */
+#else
 # include "VBoxUtils.h"
-#endif /* VBOX_WS_MAC */
+#endif
 
 /* COM includes: */
@@ -124,5 +125,5 @@
 
     /* Do not try to change visual-state type in 'manual override' mode: */
-    if (uisession()->isManualOverrideMode())
+    if (uimachine()->isManualOverrideMode())
         return;
 
