Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 38961)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 38962)
@@ -158,4 +158,7 @@
     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());
@@ -671,6 +674,5 @@
 void UIMachineView::storeConsoleSize(int iWidth, int iHeight)
 {
-    if (m_desktopGeometryType == DesktopGeo_Automatic)
-        m_storedConsoleSize = QSize(iWidth, iHeight);
+    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 38961)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp	(revision 38962)
@@ -126,4 +126,7 @@
             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());
@@ -183,6 +186,4 @@
                 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 38961)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp	(revision 38962)
@@ -77,4 +77,7 @@
 UIMachineViewNormal::~UIMachineViewNormal()
 {
+    /* Save machine view settings: */
+    saveMachineViewSettings();
+
     /* Cleanup frame buffer: */
     cleanupFrameBuffer();
@@ -113,4 +116,7 @@
             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());
@@ -168,8 +174,4 @@
             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()));
@@ -250,4 +252,10 @@
 }
 
+void UIMachineViewNormal::saveMachineViewSettings()
+{
+    /* Store guest size hint: */
+    storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height()));
+}
+
 void UIMachineViewNormal::setGuestAutoresizeEnabled(bool fEnabled)
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h	(revision 38961)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h	(revision 38962)
@@ -67,5 +67,5 @@
 
     /* Cleanup helpers: */
-    // void saveMachineViewSettings();
+    void saveMachineViewSettings();
     //void cleanupConsoleConnections() {}
     //void prepareConnections() {}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp	(revision 38961)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp	(revision 38962)
@@ -76,4 +76,7 @@
 UIMachineViewScale::~UIMachineViewScale()
 {
+    /* Save machine view settings: */
+    saveMachineViewSettings();
+
     /* Cleanup frame buffer: */
     cleanupFrameBuffer();
@@ -172,4 +175,7 @@
             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: */
@@ -347,4 +353,10 @@
 }
 
+void UIMachineViewScale::saveMachineViewSettings()
+{
+    /* Store guest size hint: */
+    storeGuestSizeHint(QSize(frameBuffer()->width(), frameBuffer()->height()));
+}
+
 QSize UIMachineViewScale::sizeHint() const
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h	(revision 38961)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h	(revision 38962)
@@ -64,5 +64,5 @@
 
     /* Cleanup helpers: */
-    // void saveMachineViewSettings();
+    void saveMachineViewSettings();
     //void cleanupConnections() {}
     //void cleanupFrameBuffer() {}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 38961)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 38962)
@@ -137,4 +137,7 @@
             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());
@@ -191,6 +194,4 @@
                 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())
