Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 49177)
@@ -271,4 +271,11 @@
 }
 
+/** Adjusts guest screen size for each the machine-window we have. */
+void UIMachineLogic::maybeAdjustGuestScreenSize()
+{
+    foreach(UIMachineWindow *pMachineWindow, machineWindows())
+        pMachineWindow->machineView()->maybeAdjustGuestScreenSize();
+}
+
 #ifdef Q_WS_MAC
 void UIMachineLogic::updateDockIcon()
@@ -1120,6 +1127,6 @@
             pMachineWindow->showNormal();
 
-        /* Normalize view's geometry: */
-        pMachineWindow->machineView()->normalizeGeometry(true);
+        /* Normalize window geometry: */
+        pMachineWindow->normalizeGeometry(true);
     }
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 49177)
@@ -79,4 +79,7 @@
     bool isPreventAutoClose() const { return m_fIsPreventAutoClose; }
     void setPreventAutoClose(bool fIsPreventAutoClose) { m_fIsPreventAutoClose = fIsPreventAutoClose; }
+
+    /* API: Guest screen size stuff: */
+    void maybeAdjustGuestScreenSize();
 
     /* Wrapper to open Machine settings / Network page: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 49177)
@@ -275,5 +275,5 @@
             /* Normalize machine-window geometry: */
             if (visualStateType() == UIVisualStateType_Normal)
-                normalizeGeometry(true /* Adjust Position? */);
+                machineWindow()->normalizeGeometry(true /* adjust position */);
         }
     }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 49177)
@@ -76,6 +76,7 @@
     virtual void setGuestAutoresizeEnabled(bool /* fEnabled */) {}
 
-    /* Public members: */
-    virtual void normalizeGeometry(bool /* bAdjustPosition = false */) = 0;
+    /** Adjusts guest screen size to correspond current machine-window size.
+      * @note Reimplemented in sub-classes. Base implementation does nothing. */
+    virtual void maybeAdjustGuestScreenSize() {}
 
     /* Framebuffer aspect ratio: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h	(revision 49177)
@@ -61,4 +61,9 @@
     CSession& session() const;
     CMachine machine() const;
+
+    /** Adjusts machine-window size to correspond current guest screen size.
+      * @param fAdjustPosition determines whether is it necessary to adjust position too.
+      * @note  Reimplemented in sub-classes. Base implementation does nothing. */
+    virtual void normalizeGeometry(bool fAdjustPosition) { Q_UNUSED(fAdjustPosition); }
 
 #ifndef VBOX_WITH_TRANSLUCENT_SEAMLESS
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 49177)
@@ -206,20 +206,4 @@
 }
 
-void UISession::adjustGuestView()
-{
-    foreach(UIMachineWindow *pMachineWindow, machineLogic()->machineWindows())
-    {
-        bool fAdjustPosition = false;
-        UIVisualStateType visualStateType = machineLogic()->visualStateType();
-
-        if (visualStateType == UIVisualStateType_Normal ||
-            visualStateType == UIVisualStateType_Scale)
-            fAdjustPosition = true;
-
-        /* Normalize view's geometry: */
-        pMachineWindow->machineView()->normalizeGeometry(fAdjustPosition);
-    }
-}
-
 void UISession::powerUp()
 {
@@ -276,7 +260,6 @@
     {
         msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_restore_90px.png", 0, 0);
-        /* If restoring from saved state, guest MachineView
-           should be notified about host MachineWindow geometry change */
-        adjustGuestView();
+        /* After restoring from 'saved' state, guest screen size should be adjusted: */
+        machineLogic()->maybeAdjustGuestScreenSize();
     }
     else
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 49177)
@@ -271,5 +271,4 @@
     void reinitMenuPool();
     bool preparePowerUp();
-    void adjustGuestView();
     int countOfVisibleWindows();
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp	(revision 49177)
@@ -63,5 +63,5 @@
 void UIMachineViewFullscreen::sltAdditionsStateChanged()
 {
-    normalizeGeometry(false);
+    maybeAdjustGuestScreenSize();
 }
 
@@ -136,5 +136,6 @@
 }
 
-void UIMachineViewFullscreen::normalizeGeometry(bool /* fAdjustPosition */)
+/** Adjusts guest screen size to correspond current <i>working area</i> size. */
+void UIMachineViewFullscreen::maybeAdjustGuestScreenSize()
 {
     /* Check if we should adjust guest to new size: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h	(revision 49177)
@@ -62,6 +62,6 @@
     void setGuestAutoresizeEnabled(bool bEnabled);
 
-    /* Private helpers: */
-    void normalizeGeometry(bool fAdjustPosition);
+    /* Helpers: Geometry stuff: */
+    void maybeAdjustGuestScreenSize();
     QRect workingArea() const;
     QSize calculateMaxGuestSize() const;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 49177)
@@ -165,6 +165,6 @@
     /* Resize to the appropriate size: */
     resize(workingArea.size());
-    /* Adjust guest if necessary: */
-    machineView()->normalizeGeometry(false);
+    /* Adjust guest screen size if necessary: */
+    machineView()->maybeAdjustGuestScreenSize();
     /* Move mini-toolbar into appropriate place: */
     if (m_pMiniToolBar)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 49177)
@@ -49,7 +49,8 @@
     , m_bIsGuestAutoresizeEnabled(gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->isChecked())
 {
-
-    /* Initialization: */
-    sltAdditionsStateChanged();
+    /* Resend the last resize hint if there was a fullscreen or
+     * seamless transition previously. If we were not in graphical
+     * mode initially after the transition this happens when we switch. */
+    maybeResendResizeHint();
 }
 
@@ -65,9 +66,5 @@
 void UIMachineViewNormal::sltAdditionsStateChanged()
 {
-    /* Resend the last resize hint if there was a fullscreen or
-     * seamless transition previously.  If we were not in graphical
-     * mode initially after the transition this happens when we
-     * switch. */
-    maybeResendResizeHint();
+    maybeAdjustGuestScreenSize();
 }
 
@@ -194,51 +191,13 @@
 }
 
-void UIMachineViewNormal::normalizeGeometry(bool bAdjustPosition)
-{
-#ifndef VBOX_GUI_WITH_CUSTOMIZATIONS1
-    QWidget *pTopLevelWidget = window();
-
-    /* Calculate client window offsets: */
-    QRect frameGeo = pTopLevelWidget->frameGeometry();
-    QRect geo = pTopLevelWidget->geometry();
-    int dl = geo.left() - frameGeo.left();
-    int dt = geo.top() - frameGeo.top();
-    int dr = frameGeo.right() - geo.right();
-    int db = frameGeo.bottom() - geo.bottom();
-
-    /* Get the best size w/o scroll bars: */
-    QSize s = pTopLevelWidget->sizeHint();
-
-    /* Resize the frame to fit the contents: */
-    s -= pTopLevelWidget->size();
-    frameGeo.setRight(frameGeo.right() + s.width());
-    frameGeo.setBottom(frameGeo.bottom() + s.height());
-
-    if (bAdjustPosition)
-    {
-        QRegion availableGeo;
-        QDesktopWidget *dwt = QApplication::desktop();
-        if (dwt->isVirtualDesktop())
-            /* Compose complex available region */
-            for (int i = 0; i < dwt->numScreens(); ++ i)
-                availableGeo += dwt->availableGeometry(i);
-        else
-            /* Get just a simple available rectangle */
-            availableGeo = dwt->availableGeometry(pTopLevelWidget->pos());
-
-        frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo);
-    }
-
-#if 0
-    /* Center the frame on the desktop: */
-    frameGeo.moveCenter(availableGeo.center());
-#endif
-
-    /* Finally, set the frame geometry */
-    pTopLevelWidget->setGeometry(frameGeo.left() + dl, frameGeo.top() + dt, frameGeo.width() - dl - dr, frameGeo.height() - dt - db);
-
-#else /* !VBOX_GUI_WITH_CUSTOMIZATIONS1 */
-    Q_UNUSED(bAdjustPosition);
-#endif /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */
+/** Adjusts guest screen size to correspond current machine-window size. */
+void UIMachineViewNormal::maybeAdjustGuestScreenSize()
+{
+    /* Check if we should adjust guest to new size: */
+    QSize centralWidgetSize = machineWindow()->centralWidget()->size();
+    if ((int)frameBuffer()->width() != centralWidgetSize.width() ||
+        (int)frameBuffer()->height() != centralWidgetSize.height())
+        if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
+            sltPerformGuestResize(centralWidgetSize);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h	(revision 49177)
@@ -44,10 +44,4 @@
     void sltAdditionsStateChanged();
 
-#ifdef Q_WS_X11
-    /* Slot to perform synchronized geometry normalization.
-     * Currently its only required under X11 as of its async nature: */
-    virtual void sltNormalizeGeometry() { normalizeGeometry(true); }
-#endif /* Q_WS_X11 */
-
 private:
 
@@ -72,5 +66,5 @@
     /* Private helpers: */
     void maybeResendResizeHint();
-    void normalizeGeometry(bool fAdjustPosition);
+    void maybeAdjustGuestScreenSize();
     QRect workingArea() const;
     QSize calculateMaxGuestSize() const;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp	(revision 49177)
@@ -457,6 +457,6 @@
                 m_normalGeometry = QRect(x, y, width(), height());
                 setGeometry(m_normalGeometry);
-                if (machineView())
-                    machineView()->normalizeGeometry(false);
+                /* Normalize to the optimal size: */
+                normalizeGeometry(false);
             }
             /* Maximize if needed: */
@@ -466,7 +466,6 @@
         else
         {
-            /* Normalize view early to the optimal size: */
-            if (machineView())
-                machineView()->normalizeGeometry(true);
+            /* Normalize to the optimal size: */
+            normalizeGeometry(true);
             /* Move newly created window to the screen center: */
             m_normalGeometry = geometry();
@@ -475,11 +474,10 @@
         }
 
-        /* Normalize view to the optimal size: */
-        if (machineView())
+        /* Normalize to the optimal size: */
 #ifdef Q_WS_X11
-            QTimer::singleShot(0, machineView(), SLOT(sltNormalizeGeometry()));
-#else /* Q_WS_X11 */
-            machineView()->normalizeGeometry(true);
-#endif
+        QTimer::singleShot(0, this, SLOT(sltNormalizeGeometry()));
+#else /* !Q_WS_X11 */
+        normalizeGeometry(true);
+#endif /* !Q_WS_X11 */
     }
 
@@ -611,4 +609,56 @@
 }
 
+/**
+ * Adjusts machine-window size to correspond current guest screen size.
+ * @param fAdjustPosition determines whether is it necessary to adjust position too.
+ */
+void UIMachineWindowNormal::normalizeGeometry(bool fAdjustPosition)
+{
+#ifndef VBOX_GUI_WITH_CUSTOMIZATIONS1
+    /* Skip if maximized: */
+    if (isMaximized())
+        return;
+
+    /* Calculate client window offsets: */
+    QRect frameGeo = frameGeometry();
+    QRect geo = geometry();
+    int dl = geo.left() - frameGeo.left();
+    int dt = geo.top() - frameGeo.top();
+    int dr = frameGeo.right() - geo.right();
+    int db = frameGeo.bottom() - geo.bottom();
+
+    /* Get the best size w/o scroll-bars: */
+    QSize s = sizeHint();
+
+    /* Resize the frame to fit the contents: */
+    s -= size();
+    frameGeo.setRight(frameGeo.right() + s.width());
+    frameGeo.setBottom(frameGeo.bottom() + s.height());
+
+    /* Adjust position if necessary: */
+    if (fAdjustPosition)
+    {
+        QRegion availableGeo;
+        QDesktopWidget *dwt = QApplication::desktop();
+        if (dwt->isVirtualDesktop())
+            /* Compose complex available region: */
+            for (int i = 0; i < dwt->numScreens(); ++i)
+                availableGeo += dwt->availableGeometry(i);
+        else
+            /* Get just a simple available rectangle */
+            availableGeo = dwt->availableGeometry(pos());
+
+        frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo);
+    }
+
+    /* Finally, set the frame geometry: */
+    setGeometry(frameGeo.left() + dl, frameGeo.top() + dt,
+                frameGeo.width() - dl - dr, frameGeo.height() - dt - db);
+
+#else /* !VBOX_GUI_WITH_CUSTOMIZATIONS1 */
+    Q_UNUSED(fAdjustPosition);
+#endif /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */
+}
+
 void UIMachineWindowNormal::updateAppearanceOf(int iElement)
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h	(revision 49177)
@@ -43,4 +43,9 @@
 private slots:
 
+#ifdef Q_WS_X11
+    /** X11: Performs machine-window async geometry normalization. */
+    void sltNormalizeGeometry() { normalizeGeometry(true); }
+#endif /* Q_WS_X11 */
+
     /* Session event-handlers: */
     void sltMachineStateChanged();
@@ -82,4 +87,7 @@
     void showInNecessaryMode();
 
+    /* Helper: Machine-window geometry stuff: */
+    void normalizeGeometry(bool fAdjustPosition);
+
     /* Update stuff: */
     void updateAppearanceOf(int aElement);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h	(revision 49177)
@@ -65,5 +65,4 @@
     /* Private helpers: */
     QSize sizeHint() const;
-    void normalizeGeometry(bool /* fAdjustPosition */) {}
     QRect workingArea() const;
     QSize calculateMaxGuestSize() const;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 49177)
@@ -72,5 +72,5 @@
 void UIMachineViewSeamless::sltAdditionsStateChanged()
 {
-    normalizeGeometry(false);
+    maybeAdjustGuestScreenSize();
 }
 
@@ -154,5 +154,6 @@
 }
 
-void UIMachineViewSeamless::normalizeGeometry(bool /* fAdjustPosition */)
+/** Adjusts guest screen size to correspond current <i>working area</i> size. */
+void UIMachineViewSeamless::maybeAdjustGuestScreenSize()
 {
     /* Check if we should adjust guest to new size: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h	(revision 49177)
@@ -64,6 +64,6 @@
     //void cleanupCommon() {}
 
-    /* Private helpers: */
-    void normalizeGeometry(bool fAdjustPosition);
+    /* Helpers: Geometry stuff: */
+    void maybeAdjustGuestScreenSize();
     QRect workingArea() const;
     QSize calculateMaxGuestSize() const;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp	(revision 49176)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp	(revision 49177)
@@ -197,6 +197,6 @@
     /* Resize to the appropriate size: */
     resize(workingArea.size());
-    /* Adjust guest if necessary: */
-    machineView()->normalizeGeometry(false);
+    /* Adjust guest screen size if necessary: */
+    machineView()->maybeAdjustGuestScreenSize();
 #ifndef Q_WS_MAC
     /* Move mini-toolbar into appropriate place: */
