Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 27235)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 27236)
@@ -423,20 +423,4 @@
 #endif
 
-void UIMachineView::updateSliders()
-{
-    QSize p = viewport()->size();
-    QSize m = maximumViewportSize();
-
-    QSize v = QSize(m_pFrameBuffer->width(), m_pFrameBuffer->height());
-    /* No scroll bars needed: */
-    if (m.expandedTo(v) == m)
-        p = m;
-
-    horizontalScrollBar()->setRange(0, v.width() - p.width());
-    verticalScrollBar()->setRange(0, v.height() - p.height());
-    horizontalScrollBar()->setPageStep(p.width());
-    verticalScrollBar()->setPageStep(p.height());
-}
-
 void UIMachineView::prepareFrameBuffer()
 {
@@ -688,4 +672,80 @@
             }
             break;
+        }
+
+        case VBoxDefs::ResizeEventType:
+        {
+            /* Some situations require framebuffer resize events to be ignored,
+             * leaving machine window & machine view & framebuffer sizes preserved: */
+            if (uisession()->isGuestResizeIgnored())
+                return true;
+
+            /* We are starting to perform machine view resize: */
+            bool oldIgnoreMainwndResize = isMachineWindowResizeIgnored();
+            setMachineWindowResizeIgnored(true);
+
+            /* Get guest resize-event: */
+            UIResizeEvent *pResizeEvent = static_cast<UIResizeEvent*>(pEvent);
+
+            /* Perform framebuffer resize: */
+            frameBuffer()->resizeEvent(pResizeEvent);
+
+            /* Reapply maximum size restriction for machine view: */
+            setMaximumSize(sizeHint());
+
+            /* Store the new size to prevent unwanted resize hints being sent back: */
+            storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
+
+            /* Perform machine-view resize: */
+            resize(pResizeEvent->width(), pResizeEvent->height());
+
+            /* Let our toplevel widget calculate its sizeHint properly. */
+#ifdef Q_WS_X11
+            /* We use processEvents rather than sendPostedEvents & set the time out value to max cause on X11 otherwise
+             * the layout isn't calculated correctly. Dosn't find the bug in Qt, but this could be triggered through
+             * the async nature of the X11 window event system. */
+            QCoreApplication::processEvents(QEventLoop::AllEvents, INT_MAX);
+#else /* Q_WS_X11 */
+            QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest);
+#endif /* Q_WS_X11 */
+
+#ifdef Q_WS_MAC
+            // TODO_NEW_CORE
+//            mDockIconPreview->setOriginalSize(pResizeEvent->width(), pResizeEvent->height());
+#endif /* Q_WS_MAC */
+
+            /* Update mouse cursor shape: */
+            updateMouseCursorShape();
+#ifdef Q_WS_WIN32
+            updateMouseCursorClipping();
+#endif
+
+            /* May be we have to restrict minimum size? */
+            maybeRestrictMinimumSize();
+
+            /* Update machine-view sliders: */
+            updateSliders();
+
+            /* Normalize geometry: */
+            normalizeGeometry(true /* adjustPosition */);
+
+            /* Report to the VM thread that we finished resizing */
+            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
+
+            /* We are finishing to perform machine-view resize: */
+            setMachineWindowResizeIgnored(oldIgnoreMainwndResize);
+
+            /* Make sure that all posted signals are processed: */
+            qApp->processEvents();
+
+            /* We also recalculate the desktop geometry if this is determined
+             * automatically.  In fact, we only need this on the first resize,
+             * but it is done every time to keep the code simpler. */
+            calculateDesktopGeometry();
+
+            /* Emit a signal about guest was resized: */
+            emit resizeHintDone();
+
+            return true;
         }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 27235)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 27236)
@@ -71,5 +71,5 @@
 
     /* Public members: */
-    virtual void normalizeGeometry(bool /* bAdjustPosition = false */) {}
+    virtual void normalizeGeometry(bool /* bAdjustPosition = false */) = 0;
 
 signals:
@@ -125,5 +125,7 @@
     void updateMouseCursorClipping();
 #endif
-    void updateSliders();
+    virtual QRect availableGeometry() = 0;
+    virtual void maybeRestrictMinimumSize() = 0;
+    virtual void updateSliders() =  0;
 
 #ifdef Q_WS_MAC
@@ -208,6 +210,4 @@
     void releaseAllPressedKeys(bool aReleaseHostKey = true);
     void sendChangedKeyStates();
-
-    virtual QRect availableGeometry() = 0;
 
     static void dimImage(QImage &img);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp	(revision 27235)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp	(revision 27236)
@@ -148,79 +148,11 @@
     switch (pEvent->type())
     {
-        case VBoxDefs::ResizeEventType:
-        {
-            /* Some situations require framebuffer resize events to be ignored,
-             * leaving machine window & machine view & framebuffer sizes preserved: */
-            if (uisession()->isGuestResizeIgnored())
-                return true;
-
-            /* We are starting to perform machine view resize: */
-            bool oldIgnoreMainwndResize = isMachineWindowResizeIgnored();
-            setMachineWindowResizeIgnored(true);
-
-            /* Get guest resize-event: */
-            UIResizeEvent *pResizeEvent = static_cast<UIResizeEvent*>(pEvent);
-
-            /* Perform framebuffer resize: */
-            frameBuffer()->resizeEvent(pResizeEvent);
-
-            /* Reapply maximum size restriction for machine view: */
-            setMaximumSize(sizeHint());
-
-            /* Store the new size to prevent unwanted resize hints being sent back: */
-            storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
-
-            /* Perform machine view resize: */
-            resize(pResizeEvent->width(), pResizeEvent->height());
-
-            /* Let our toplevel widget calculate its sizeHint properly. */
-#ifdef Q_WS_X11
-            /* We use processEvents rather than sendPostedEvents & set the time out value to max cause on X11 otherwise
-             * the layout isn't calculated correctly. Dosn't find the bug in Qt, but this could be triggered through
-             * the async nature of the X11 window event system. */
-            QCoreApplication::processEvents(QEventLoop::AllEvents, INT_MAX);
-#else /* Q_WS_X11 */
-            QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest);
-#endif /* Q_WS_X11 */
-
-#ifdef Q_WS_MAC
-            // TODO_NEW_CORE
-//            mDockIconPreview->setOriginalSize(pResizeEvent->width(), pResizeEvent->height());
-#endif /* Q_WS_MAC */
-
-            /* Update mouse cursor shape: */
-            updateMouseCursorShape();
-#ifdef Q_WS_WIN32
-            updateMouseCursorClipping();
-#endif
-
-            /* May be we have to restrict minimum size? */
-            maybeRestrictMinimumSize();
-
-            /* Report to the VM thread that we finished resizing */
-            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
-
-            /* We are finishing to perform machine view resize: */
-            setMachineWindowResizeIgnored(oldIgnoreMainwndResize);
-
-            /* Make sure that all posted signals are processed: */
-            qApp->processEvents();
-
-            /* We also recalculate the desktop geometry if this is determined automatically.
-             * In fact, we only need this on the first resize,
-             * but it is done every time to keep the code simpler. */
-            calculateDesktopGeometry();
-
-            /* Emit a signal about guest was resized: */
-            emit resizeHintDone();
-
-            return true;
-        }
-
         case QEvent::KeyPress:
         case QEvent::KeyRelease:
         {
+            /* Get key-event: */
             QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);
 
+            /* Process Host+Home for menu popup: */
             if (isHostKeyPressed() && pEvent->type() == QEvent::KeyPress)
             {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h	(revision 27235)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h	(revision 27236)
@@ -77,6 +77,8 @@
 
     /* Private helpers: */
+    void normalizeGeometry(bool /* fAdjustPosition */) {}
     QRect availableGeometry();
     void maybeRestrictMinimumSize();
+    void updateSliders() {}
 
     /* Private members: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 27235)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 27236)
@@ -26,4 +26,5 @@
 #include <QDesktopWidget>
 #include <QMenuBar>
+#include <QScrollBar>
 #include <QTimer>
 
@@ -90,10 +91,4 @@
 }
 
-void UIMachineViewNormal::sltAdditionsStateChanged()
-{
-    /* Check if we should restrict minimum size: */
-    maybeRestrictMinimumSize();
-}
-
 void UIMachineViewNormal::sltPerformGuestResize(const QSize &toSize)
 {
@@ -132,7 +127,13 @@
 }
 
-/* If the desktop geometry is set automatically, this will update it: */
+void UIMachineViewNormal::sltAdditionsStateChanged()
+{
+    /* Check if we should restrict minimum size: */
+    maybeRestrictMinimumSize();
+}
+
 void UIMachineViewNormal::sltDesktopResized()
 {
+    /* If the desktop geometry is set automatically, this will update it: */
     calculateDesktopGeometry();
 }
@@ -142,88 +143,13 @@
     switch (pEvent->type())
     {
-        case VBoxDefs::ResizeEventType:
-        {
-            /* Some situations require framebuffer resize events to be ignored,
-             * leaving machine window & machine view & framebuffer sizes preserved: */
-            if (uisession()->isGuestResizeIgnored())
-                return true;
-
-            /* We are starting to perform machine view resize: */
-            bool oldIgnoreMainwndResize = isMachineWindowResizeIgnored();
-            setMachineWindowResizeIgnored(true);
-
-            /* Get guest resize-event: */
-            UIResizeEvent *pResizeEvent = static_cast<UIResizeEvent*>(pEvent);
-
-            /* Perform framebuffer resize: */
-            frameBuffer()->resizeEvent(pResizeEvent);
-
-            /* Reapply maximum size restriction for machine view: */
-            setMaximumSize(sizeHint());
-
-            /* Store the new size to prevent unwanted resize hints being sent back. */
-            storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
-
-            /* Resize the guest canvas: */
-            resize(pResizeEvent->width(), pResizeEvent->height());
-
-            /* Let our toplevel widget calculate its sizeHint properly. */
-#ifdef Q_WS_X11
-            /* We use processEvents rather than sendPostedEvents & set the time out value to max cause on X11 otherwise
-             * the layout isn't calculated correctly. Dosn't find the bug in Qt, but this could be triggered through
-             * the async nature of the X11 window event system. */
-            QCoreApplication::processEvents(QEventLoop::AllEvents, INT_MAX);
-#else /* Q_WS_X11 */
-            QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest);
-#endif /* Q_WS_X11 */
-
-#ifdef Q_WS_MAC
-            // TODO_NEW_CORE
-//            mDockIconPreview->setOriginalSize(pResizeEvent->width(), pResizeEvent->height());
-#endif /* Q_WS_MAC */
-
-            /* Update mouse cursor shape: */
-            updateMouseCursorShape();
-#ifdef Q_WS_WIN32
-            updateMouseCursorClipping();
-#endif
-
-            /* May be we have to restrict minimum size? */
-            maybeRestrictMinimumSize();
-
-            /* Update machine view sliders: */
-            updateSliders();
-
-            /* Normalize geometry: */
-            normalizeGeometry(true /* adjustPosition */);
-
-            /* Report to the VM thread that we finished resizing */
-            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
-
-            /* We are finishing to perform machine view resize: */
-            setMachineWindowResizeIgnored(oldIgnoreMainwndResize);
-
-            /* Make sure that all posted signals are processed: */
-            qApp->processEvents();
-
-            /* We also recalculate the desktop geometry if this is determined
-             * automatically.  In fact, we only need this on the first resize,
-             * but it is done every time to keep the code simpler. */
-            calculateDesktopGeometry();
-
-            /* Emit a signal about guest was resized: */
-            emit resizeHintDone();
-
-            return true;
-        }
-
         case QEvent::KeyPress:
         case QEvent::KeyRelease:
         {
+            /* Get key-event: */
             QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);
 
+            /* Process Host+Home as menu-bar activator: */
             if (isHostKeyPressed() && pEvent->type() == QEvent::KeyPress)
             {
-                /* Process Host+Home as menu-bar activator: */
                 if (pKeyEvent->key() == Qt::Key_Home)
                 {
@@ -411,2 +337,18 @@
 }
 
+void UIMachineViewNormal::updateSliders()
+{
+    QSize p = viewport()->size();
+    QSize m = maximumViewportSize();
+
+    QSize v = QSize(frameBuffer()->width(), frameBuffer()->height());
+    /* No scroll bars needed: */
+    if (m.expandedTo(v) == m)
+        p = m;
+
+    horizontalScrollBar()->setRange(0, v.width() - p.width());
+    verticalScrollBar()->setRange(0, v.height() - p.height());
+    horizontalScrollBar()->setPageStep(p.width());
+    verticalScrollBar()->setPageStep(p.height());
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h	(revision 27235)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h	(revision 27236)
@@ -78,4 +78,5 @@
     QRect availableGeometry();
     void maybeRestrictMinimumSize();
+    void updateSliders();
 
     /* Private members: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 27235)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 27236)
@@ -147,74 +147,10 @@
     switch (pEvent->type())
     {
-        case VBoxDefs::ResizeEventType:
-        {
-            /* Some situations require framebuffer resize events to be ignored,
-             * leaving machine window & machine view & framebuffer sizes preserved: */
-            if (uisession()->isGuestResizeIgnored())
-                return true;
-
-            /* We are starting to perform machine view resize: */
-            bool oldIgnoreMainwndResize = isMachineWindowResizeIgnored();
-            setMachineWindowResizeIgnored(true);
-
-            /* Get guest resize-event: */
-            UIResizeEvent *pResizeEvent = static_cast<UIResizeEvent*>(pEvent);
-
-            /* Perform framebuffer resize: */
-            frameBuffer()->resizeEvent(pResizeEvent);
-
-            /* Reapply maximum size restriction for machine view: */
-            setMaximumSize(sizeHint());
-
-            /* Store the new size to prevent unwanted resize hints being sent back: */
-            storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
-
-            /* Perform machine view resize: */
-            resize(pResizeEvent->width(), pResizeEvent->height());
-
-            /* Let our toplevel widget calculate its sizeHint properly. */
-#ifdef Q_WS_X11
-            /* We use processEvents rather than sendPostedEvents & set the time out value to max cause on X11 otherwise
-             * the layout isn't calculated correctly. Dosn't find the bug in Qt, but this could be triggered through
-             * the async nature of the X11 window event system. */
-            QCoreApplication::processEvents(QEventLoop::AllEvents, INT_MAX);
-#else /* Q_WS_X11 */
-            QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest);
-#endif /* Q_WS_X11 */
-
-#ifdef Q_WS_MAC
-            // TODO_NEW_CORE
-            //mDockIconPreview->setOriginalSize(pResizeEvent->width(), pResizeEvent->height());
-#endif /* Q_WS_MAC */
-
-            /* Update mouse cursor shape: */
-            updateMouseCursorShape();
-#ifdef Q_WS_WIN32
-            updateMouseCursorClipping();
-#endif
-
-            /* Report to the VM thread that we finished resizing: */
-            session().GetConsole().GetDisplay().ResizeCompleted(screenId());
-
-            /* We are finishing to perform machine view resize: */
-            setMachineWindowResizeIgnored(oldIgnoreMainwndResize);
-
-            /* Make sure that all posted signals are processed: */
-            qApp->processEvents();
-
-            /* We also recalculate the desktop geometry if this is determined automatically.
-             * In fact, we only need this on the first resize,
-             * but it is done every time to keep the code simpler. */
-            calculateDesktopGeometry();
-
-            /* Emit a signal about guest was resized: */
-            emit resizeHintDone();
-
-            return true;
-        }
-
         case VBoxDefs::SetRegionEventType:
         {
+            /* Get region-update event: */
             UISetRegionEvent *pSetRegionEvent = static_cast<UISetRegionEvent*>(pEvent);
+
+            /* Apply new region: */
             if (pSetRegionEvent->region() != m_lastVisibleRegion)
             {
@@ -228,6 +164,8 @@
         case QEvent::KeyRelease:
         {
+            /* Get key-event: */
             QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);
 
+            /* Process Host+Home for menu popup: */
             if (isHostKeyPressed() && pEvent->type() == QEvent::KeyPress)
             {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h	(revision 27235)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h	(revision 27236)
@@ -74,5 +74,8 @@
 
     /* Private helpers: */
+    void normalizeGeometry(bool /* fAdjustPosition */) {}
     QRect availableGeometry();
+    void maybeRestrictMinimumSize() {}
+    void updateSliders() {}
 
     /* Private variables: */
