Index: trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h	(revision 2699)
+++ trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h	(revision 2700)
@@ -49,4 +49,17 @@
 class QMenuData;
 
+/** Auto-resize event.
+  * Useful for posting into events queue to be processed just after all
+  * QEvent::Resize & QEvent::WindowStateChange events currently posted.
+  * This is necessary due to these two events - QEvent::Resize &
+  * QEvent::WindowStateChange are processed in different sequence
+  * under Win32 and X11. */
+class AutoResizeEvent : public QEvent
+{
+public:
+    AutoResizeEvent () :
+        QEvent ((QEvent::Type) VBoxDefs::AutoResizeEventType) {}
+};
+
 class VBoxConsoleView : public QScrollView
 {
@@ -96,4 +109,5 @@
     void mouseStateChanged (int state);
     void machineStateChanged (CEnums::MachineState state);
+    void additionsStateChanged (const QString &, bool);
 
 protected:
@@ -169,8 +183,10 @@
     static void dimImage (QImage &img);
 
+    void performAutoResize();
+
 private slots:
 
     void doResizeHint();
-    void normalizeGeo() { normalizeGeometry(); }
+    void normalizeGeo() { normalizeGeometry (true); }
 
 private:
Index: trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h	(revision 2699)
+++ trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h	(revision 2700)
@@ -160,4 +160,6 @@
     void updateMouseState (int state);
 
+    void updateAdditionsState (const QString&, bool);
+
     void tryClose();
 
@@ -246,4 +248,6 @@
 
     CSession csession;
+
+    bool mIsAutoresizeEnabled;
 
     // widgets
Index: trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h	(revision 2699)
+++ trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h	(revision 2700)
@@ -128,4 +128,6 @@
         MousePointerChangeEventType,
         MachineStateChangeEventType,
+        AdditionsStateChangeEventType,
+        AutoResizeEventType,
         MachineDataChangeEventType,
         MachineRegisteredEventType,
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp	(revision 2699)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp	(revision 2700)
@@ -225,4 +225,22 @@
 };
 
+/** Guest Additions property changes. */
+class GuestAdditionsEvent : public QEvent
+{
+public:
+    GuestAdditionsEvent (const QString &aOsTypeId,
+                         const QString &aAddVersion,
+                         bool aAddActive) :
+        QEvent ((QEvent::Type) VBoxDefs::AdditionsStateChangeEventType),
+        mOsTypeId (aOsTypeId), mAddVersion (aAddVersion), mAddActive (aAddActive) {}
+    const QString &osTypeId() const { return mOsTypeId; }
+    const QString &additionVersion() const { return mAddVersion; }
+    bool additionActive() const { return mAddActive; }
+private:
+    QString mOsTypeId;
+    QString mAddVersion;
+    bool mAddActive;
+};
+
 /** Menu activation event */
 class ActivateMenuEvent : public QEvent
@@ -352,5 +370,9 @@
                       guest.GetAdditionsVersion().latin1(),
                       guest.GetAdditionsActive()));
-        /** @todo */
+        QApplication::postEvent (mView,
+                                 new GuestAdditionsEvent (
+                                     guest.GetOSTypeId(),
+                                     guest.GetAdditionsVersion(),
+                                     guest.GetAdditionsActive()));
         return S_OK;
     }
@@ -811,4 +833,5 @@
             case VBoxDefs::ResizeEventType:
             {
+                bool old_ignore_mainwnd_resize = ignore_mainwnd_resize;
                 ignore_mainwnd_resize = true;
 
@@ -842,6 +865,5 @@
                  * full screen */
                 if (!mainwnd->isTrueFullscreen() &&
-                    !topLevelWidget()->isMaximized() &&
-                    !resize_hint_timer->isActive())
+                    !topLevelWidget()->isMaximized())
                     normalizeGeometry (true /* adjustPosition */);
 
@@ -849,5 +871,5 @@
                 cconsole.GetDisplay().ResizeCompleted();
 
-                ignore_mainwnd_resize = false;
+                ignore_mainwnd_resize = old_ignore_mainwnd_resize;
 
                 return true;
@@ -912,4 +934,12 @@
                 onStateChange (me->machineState());
                 emit machineStateChanged (me->machineState());
+                return true;
+            }
+
+            case VBoxDefs::AdditionsStateChangeEventType:
+            {
+                GuestAdditionsEvent *ge = (GuestAdditionsEvent *) e;
+                LogFlowFunc (("AdditionsStateChangeEventType\n"));
+                emit additionsStateChanged (ge->additionVersion(), ge->additionActive());
                 return true;
             }
@@ -1004,4 +1034,10 @@
             }
 
+            case VBoxDefs::AutoResizeEventType:
+            {
+                performAutoResize();
+                return true;
+            }
+
             default:
                 break;
@@ -1105,4 +1141,10 @@
                     if (autoresize_guest)
                         resize_hint_timer->start (300, TRUE);
+                    /* During window maximization WindowStateChange event is
+                     * processed before Resize event, so the ignore_mainwnd_resize
+                     * variable should be set to true here in case of mainwnd is
+                     * maximized or in fullscreen state. */
+                    if (mainwnd->isMaximized() || mainwnd->isTrueFullscreen())
+                        ignore_mainwnd_resize = true;
                 }
                 break;
@@ -1110,18 +1152,11 @@
             case QEvent::WindowStateChange:
             {
-                if (!mainwnd->isMinimized())
-                {
-                    if (!mainwnd->isMaximized())
-                    {
-                        /* The guest screen size (and therefore the contents
-                         * size) could have been changed while we were maximized
-                         * or minimized, so normalize the main window size
-                         * unless we're in true fullscreen mode. Calling
-                         * normalizeGeometry() directly from here doesn't work
-                         * for some reason, so use a single shot timer. */
-                        if (!mainwnd->isTrueFullscreen())
-                            QTimer::singleShot (0, this, SLOT (normalizeGeo()));
-                    }
-                }
+                /* The guest screen size (and therefore the contents size)
+                 * could have been changed while we were maximized or minimized,
+                 * so posting event for auto-resize and normalization. */
+                if (!mainwnd->isMinimized() &&
+                    !mainwnd->isMaximized() &&
+                    !mainwnd->isTrueFullscreen())
+                    QApplication::postEvent (this, new AutoResizeEvent ());
             }
 
@@ -1483,5 +1518,5 @@
         m_darwinKeyModifiers = newMask;
 
-        /* Always return true here because we'll otherwise getting a Qt event 
+        /* Always return true here because we'll otherwise getting a Qt event
            we don't want and that will only cause the Pause warning to pop up. */
         ret = true;
@@ -1671,4 +1706,18 @@
 
 
+}
+
+void VBoxConsoleView::performAutoResize()
+{
+    if (autoresize_guest)
+    {
+        doResizeHint();
+        QTimer::singleShot (200, this, SLOT (normalizeGeo()));
+    }
+    else
+    {
+        normalizeGeo();
+    }
+    ignore_mainwnd_resize = false;
 }
 
@@ -2452,5 +2501,5 @@
     // Note, that it's just a guess that sending RESEND will give the desired
     // effect :), but at least it works with NT and W2k guests.
-    /** @todo This seems to causes linux guests (in console mode) to cough a bit. 
+    /** @todo This seems to causes linux guests (in console mode) to cough a bit.
      * We need to check if this is the cause of #1944 and/or #1949. --bird */
     codes [0] = 0xFE;
@@ -2477,5 +2526,5 @@
     m_darwinKeyModifiers &= alphaLock | kEventKeyModifierNumLockMask
                           | (release_hostkey ? 0 : ::DarwinKeyCodeToDarwinModifierMask (gs.hostKey()));
-#endif 
+#endif
 
     emitKeyboardStateChanged ();
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 2699)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 2700)
@@ -57,4 +57,9 @@
 #include <qtimer.h>
 
+#include <VBox/VBoxGuest.h>
+#define VBOX_GUEST_ADDITIONS_VERSION_OK(additionsVersion) \
+        (RT_HIWORD(additionsVersion) == RT_HIWORD(VMMDEV_VERSION) && \
+         RT_LOWORD(additionsVersion) <= RT_LOWORD(VMMDEV_VERSION))
+
 #if defined(Q_WS_X11)
 #include <X11/Xlib.h>
@@ -214,4 +219,5 @@
     , dbgMenu (NULL)
 #endif
+    , mIsAutoresizeEnabled (false)
     , console (0)
     , mUsbLedTip (0)
@@ -268,4 +274,5 @@
         VBoxGlobal::iconSet ("auto_resize_on_16px.png", "auto_resize_on_disabled_16px.png"));
     vmAutoresizeGuestAction->setToggleAction (true);
+    vmAutoresizeGuestAction->setEnabled (false);
 
     vmAdjustWindowAction = new QAction (this, "vmAdjustWindowAction");
@@ -722,5 +729,5 @@
         str = cmachine.GetExtraData (GUI_AutoresizeGuest);
         if (str != "off")
-            vmAutoresizeGuestAction->setOn (true);
+            mIsAutoresizeEnabled = true;
 
         str = cmachine.GetExtraData (GUI_LastWindowPosition);
@@ -825,4 +832,6 @@
     connect (console, SIGNAL (machineStateChanged (CEnums::MachineState)),
              this, SLOT (updateMachineState (CEnums::MachineState)));
+    connect (console, SIGNAL (additionsStateChanged (const QString&, bool)),
+             this, SLOT (updateAdditionsState (const QString &, bool)));
 
 #ifdef Q_WS_MAC
@@ -1782,4 +1791,5 @@
         if (was_max)
             setWindowState (windowState() | WindowMaximized);
+        QApplication::postEvent (console, new AutoResizeEvent());
     }
 
@@ -2493,4 +2503,23 @@
 }
 
+
+void VBoxConsoleWnd::updateAdditionsState (const QString &aVersion, bool aActive)
+{
+    /* mIsAutoresizeEnabled flag stores the auto-resize status loaded from the
+     * settings and used for the activation of the autoresize feature
+     * if the additions state told us here it is activated. */
+    vmAutoresizeGuestAction->setEnabled (aActive);
+    vmAutoresizeGuestAction->setOn (aActive && mIsAutoresizeEnabled);
+
+    /* Checking for the Guest Additions version to warn user about possible
+     * compatibility issues in case of installed version is outdated. */
+    uint version = aVersion.toUInt();
+    bool isVersionOk = VBOX_GUEST_ADDITIONS_VERSION_OK (version);
+    if (!isVersionOk)
+        vboxProblem().message (this, VBoxProblemReporter::Warning,
+            tr ("<p>Current Guest Additions version is outdated. Please install "
+                "the latest version to avoid compatibility issues.</p>"));
+}
+
 /**
  *  Helper to safely close the main console window.
