Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 38962)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 38963)
@@ -158,7 +158,4 @@
     AssertMsg(newSize.isValid(), ("Size should be valid!\n"));
 
-    /* Remember the new size: */
-    storeConsoleSize(newSize.width(), newSize.height());
-
     /* Send new size-hint to the guest: */
     session().GetConsole().GetDisplay().SetVideoModeHint(newSize.width(), newSize.height(), 0, screenId());
@@ -674,5 +671,6 @@
 void UIMachineView::storeConsoleSize(int iWidth, int iHeight)
 {
-    m_storedConsoleSize = QSize(iWidth, iHeight);
+    if (m_desktopGeometryType == DesktopGeo_Automatic)
+        m_storedConsoleSize = QSize(iWidth, iHeight);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp	(revision 38962)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp	(revision 38963)
@@ -126,7 +126,4 @@
             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());
@@ -186,4 +183,6 @@
                 if (pResizeEvent->size() != workingArea().size())
                     break;
+                /* Store the new size */
+                storeConsoleSize(pResizeEvent->size().width(), pResizeEvent->size().height());
 
                 if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 38962)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 38963)
@@ -116,7 +116,4 @@
             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());
@@ -174,4 +171,8 @@
             case QEvent::Resize:
             {
+                const QSize *pSize = &static_cast<QResizeEvent *>(pEvent)
+                                    ->size();
+                /* Store the new size */
+                storeConsoleSize(pSize->width(), pSize->height());
                 if (pEvent->spontaneous() && m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
                     QTimer::singleShot(300, this, SLOT(sltPerformGuestResize()));
@@ -254,5 +255,5 @@
 void UIMachineViewNormal::saveMachineViewSettings()
 {
-    /* Store guest size hint: */
+    /* Store guest size in case we are switching to fullscreen: */
     storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height()));
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp	(revision 38962)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp	(revision 38963)
@@ -175,7 +175,4 @@
             frameBuffer()->setScaledSize(size());
             frameBuffer()->resizeEvent(pResizeEvent);
-
-            /* Store the new size to prevent unwanted resize hints being sent back: */
-            storeConsoleSize(pResizeEvent->width(), pResizeEvent->height());
 
             /* Let our toplevel widget calculate its sizeHint properly: */
@@ -355,5 +352,5 @@
 void UIMachineViewScale::saveMachineViewSettings()
 {
-    /* Store guest size hint: */
+    /* Store guest size in case we are switching to fullscreen: */
     storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height()));
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 38962)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 38963)
@@ -137,7 +137,4 @@
             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());
@@ -194,4 +191,6 @@
                 if (pResizeEvent->size() != workingArea().size())
                     break;
+                /* Store the new size to prevent unwanted resize hints being sent back: */
+                storeConsoleSize(pResizeEvent->size().width(), pResizeEvent->size().height());
 
                 if (uisession()->isGuestSupportsGraphics())
