Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp	(revision 27190)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp	(revision 27191)
@@ -1151,9 +1151,22 @@
      * support switching to a hardware pointer on demand. */
     if (enabled)
-        viewport()->setCursor (QCursor (Qt::BlankCursor));
+    {
+        mHideHostPointer = true;
+        updateHostCursor();
+    }
 
     mMouseIntegration = enabled;
 
     emitMouseStateChanged();
+}
+
+void VBoxConsoleView::updateHostCursor()
+{
+    if (!mMouseIntegration && !mMouseCaptured)
+        viewport()->unsetCursor();
+    else if (mMouseCaptured || (mMouseCanAbsolute && mHideHostPointer))
+        viewport()->setCursor(Qt::BlankCursor);
+    else
+        viewport()->setCursor(mLastCursor);
 }
 
@@ -1252,18 +1265,11 @@
                 /* restoreOverrideCursor() is broken in Qt 4.4.0 if WA_PaintOnScreen
                  * widgets are present. This is the case on linux with SDL. As
-                 * workaround we save/restore the arrow cursor manually. See
+                 * workaround we restore the arrow cursor manually after the resize. See
                  * http://trolltech.com/developer/task-tracker/index_html?id=206165&method=entry
                  * for details.
-                 *
-                 * Moreover the current cursor, which could be set by the guest,
-                 * should be restored after resize.
                  */
                 QCursor cursor;
-                if (shouldHideHostPointer())
-                    cursor = QCursor (Qt::BlankCursor);
-                else
-                    cursor = viewport()->cursor();
                 mFrameBuf->resizeEvent (re);
-                viewport()->setCursor (cursor);
+                updateHostCursor();
 
 #ifdef Q_WS_MAC
@@ -1403,5 +1409,5 @@
                     }
                     else
-                        viewport()->unsetCursor();
+                        updateHostCursor();
                     emitMouseStateChanged();
                     vboxProblem().remindAboutMouseIntegration (mMouseCanAbsolute);
@@ -3704,5 +3710,5 @@
     if (mMouseCaptured)
     {
-        viewport()->setCursor (QCursor (Qt::BlankCursor));
+        updateHostCursor();
 #ifdef Q_WS_WIN32
         QRect r = viewport()->rect();
@@ -3719,5 +3725,5 @@
         /* return the cursor to where it was when we captured it and show it */
         QCursor::setPos (mCapturedPos);
-        viewport()->unsetCursor();
+        updateHostCursor();
     }
 }
@@ -3849,5 +3855,5 @@
             if (hAlphaCursor)
             {
-                viewport()->setCursor (QCursor (hAlphaCursor));
+                mLastCursor = QCursor (hAlphaCursor);
                 ok = true;
                 if (mAlphaCursor)
@@ -3912,5 +3918,5 @@
             if (cur)
             {
-                viewport()->setCursor (QCursor (cur));
+                mLastCursor = QCursor (cur);
                 ok = true;
             }
@@ -3955,5 +3961,5 @@
         QCursor cursor (QPixmap::fromImage (image),
                         me->xHot(), me->yHot());
-        viewport()->setCursor (cursor);
+        mLastCursor = cursor;
         ok = true;
         NOREF (srcShapePtrScan);
@@ -3964,24 +3970,10 @@
 
 #endif
-        if (ok)
-            mLastCursor = viewport()->cursor();
-        else
-            viewport()->unsetCursor();
-    }
-    else
-    {
-        /*
-         * We did not get any shape data
-         */
-        if (me->isVisible())
-        {
-            viewport()->setCursor (mLastCursor);
-        }
-        else
-        {
-            viewport()->setCursor (Qt::BlankCursor);
-        }
+        if (!ok)
+            mLastCursor = QCursor();  /* in practice this is equivalent to
+                                       * unsetCursor() */
     }
     mHideHostPointer = !me->isVisible();
+    updateHostCursor();
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.h	(revision 27190)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.h	(revision 27191)
@@ -101,6 +101,5 @@
     bool mouseNeedsHostCursor() const { return mMouseNeedsHostCursor; }
 
-    bool shouldHideHostPointer() const
-    { return mMouseCaptured || (mMouseCanAbsolute && mHideHostPointer); }
+    void updateHostCursor();
 
     void setAutoresizeGuest (bool on);
