Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp	(revision 34470)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp	(revision 34471)
@@ -474,12 +474,12 @@
     machineLogic()->keyboardHandler()->prepareListener(m_uScreenId, this);
 
-    /* Register machine-view in mouse-handler: */
-    machineLogic()->mouseHandler()->addMachineView(m_uScreenId, this->machineView());
+    /* Register mouse-handler: */
+    machineLogic()->mouseHandler()->prepareListener(m_uScreenId, this);
 }
 
 void UIMachineWindow::cleanupHandlers()
 {
-    /* Unregister machine-view from mouse-handler: */
-    machineLogic()->mouseHandler()->delMachineView(m_uScreenId);
+    /* Unregister mouse-handler: */
+    machineLogic()->mouseHandler()->cleanupListener(m_uScreenId);
 
     /* Unregister keyboard-handler: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp	(revision 34470)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp	(revision 34471)
@@ -29,4 +29,5 @@
 #include "UISession.h"
 #include "UIMachineLogic.h"
+#include "UIMachineWindow.h"
 #include "UIMachineView.h"
 #include "UIFrameBuffer.h"
@@ -80,43 +81,59 @@
 }
 
-/* Registers new machine-view: */
-void UIMouseHandler::addMachineView(ulong uViewIndex, UIMachineView *pMachineView)
-{
+/* Prepare listener for particular machine-window: */
+void UIMouseHandler::prepareListener(ulong uIndex, UIMachineWindow *pMachineWindow)
+{
+    /* If that window is NOT registered yet: */
+    if (!m_windows.contains(uIndex))
+    {
+        /* Register machine-window: */
+        m_windows.insert(uIndex, pMachineWindow->machineWindow());
+        /* Install event-filter for machine-window: */
+        m_windows[uIndex]->installEventFilter(this);
+    }
+
     /* If that view is NOT registered yet: */
-    if (!m_views.contains(uViewIndex))
+    if (!m_views.contains(uIndex))
     {
         /* Register machine-view: */
-        m_views.insert(uViewIndex, pMachineView);
+        m_views.insert(uIndex, pMachineWindow->machineView());
         /* Install event-filter for machine-view: */
-        m_views[uViewIndex]->installEventFilter(this);
+        m_views[uIndex]->installEventFilter(this);
         /* Make machine-view notify mouse-handler about resizeHintDone(): */
-        connect(m_views[uViewIndex], SIGNAL(resizeHintDone()), this, SLOT(sltMousePointerShapeChanged()));
+        connect(m_views[uIndex], SIGNAL(resizeHintDone()), this, SLOT(sltMousePointerShapeChanged()));
     }
 
     /* If that viewport is NOT registered yet: */
-    if (!m_viewports.contains(uViewIndex))
+    if (!m_viewports.contains(uIndex))
     {
         /* Register machine-view-viewport: */
-        m_viewports.insert(uViewIndex, pMachineView->viewport());
+        m_viewports.insert(uIndex, pMachineWindow->machineView()->viewport());
         /* Install event-filter for machine-view-viewport: */
-        m_viewports[uViewIndex]->installEventFilter(this);
-    }
-}
-
-/* Remove registered machine-view: */
-void UIMouseHandler::delMachineView(ulong uViewIndex)
-{
-    /* If that view is registered yet: */
-    if (m_views.contains(uViewIndex))
+        m_viewports[uIndex]->installEventFilter(this);
+    }
+}
+
+/* Cleanup listener for particular machine-window: */
+void UIMouseHandler::cleanupListener(ulong uIndex)
+{
+    /* If that window still registered: */
+    if (m_windows.contains(uIndex))
+    {
+        /* Unregister machine-window: */
+        m_windows.remove(uIndex);
+    }
+
+    /* If that view still registered: */
+    if (m_views.contains(uIndex))
     {
         /* Unregister machine-view: */
-        m_views.remove(uViewIndex);
-    }
-
-    /* If that viewport is registered yet: */
-    if (m_viewports.contains(uViewIndex))
+        m_views.remove(uIndex);
+    }
+
+    /* If that viewport still registered: */
+    if (m_viewports.contains(uIndex))
     {
         /* Unregister machine-view-viewport: */
-        m_viewports.remove(uViewIndex);
+        m_viewports.remove(uIndex);
     }
 }
@@ -427,5 +444,50 @@
     if (QWidget *pWatchedWidget = qobject_cast<QWidget*>(pWatched))
     {
-        /* If it's a machine-view-viewport: */
+        /* Check if that widget is in windows list: */
+        if (m_windows.values().contains(pWatchedWidget))
+        {
+#ifdef Q_WS_WIN
+            /* Handle window events: */
+            switch (pEvent->type())
+            {
+                case QEvent::Move:
+                {
+                    /* Update mouse clipping if window was moved
+                     * by Operating System desktop manager: */
+                    updateMouseCursorClipping();
+                    break;
+                }
+                default:
+                    break;
+            }
+#endif /* Q_WS_WIN */
+        }
+
+        else
+
+        /* Check if that widget is of UIMachineView type: */
+        if (UIMachineView *pWatchedMachineView = qobject_cast<UIMachineView*>(pWatchedWidget))
+        {
+            /* Check if that widget is in views list: */
+            if (m_views.values().contains(pWatchedMachineView))
+            {
+                /* Handle view events: */
+                switch (pEvent->type())
+                {
+                    case QEvent::FocusOut:
+                    {
+                        /* Release the mouse: */
+                        releaseMouse();
+                        break;
+                    }
+                    default:
+                        break;
+                }
+            }
+        }
+
+        else
+
+        /* Check if that widget is in viewports list: */
         if (m_viewports.values().contains(pWatchedWidget))
         {
@@ -547,21 +609,4 @@
             }
         }
-        /* If no => check if that widget is of UIMachineView type: */
-        else if (UIMachineView *pWatchedMachineView = qobject_cast<UIMachineView*>(pWatchedWidget))
-        {
-            /* If it's a machine-view itself => handle machine-view events: */
-            if (m_views.values().contains(pWatchedMachineView))
-            {
-                switch (pEvent->type())
-                {
-                    case QEvent::FocusOut:
-                        /* Just release the mouse: */
-                        releaseMouse();
-                        break;
-                    default:
-                        break;
-                }
-            }
-        }
     }
     return QObject::eventFilter(pWatched, pEvent);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h	(revision 34470)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h	(revision 34471)
@@ -35,4 +35,5 @@
 class UISession;
 class UIMachineLogic;
+class UIMachineWindow;
 class UIMachineView;
 #ifdef Q_WS_X11
@@ -51,7 +52,7 @@
     static void destroy(UIMouseHandler *pMouseHandler);
 
-    /* Registers/Remove new machine-view: */
-    void addMachineView(ulong uViewIndex, UIMachineView *pMachineView);
-    void delMachineView(ulong uViewIndex);
+    /* Prepare/cleanup listener for particular machine-window: */
+    void prepareListener(ulong uIndex, UIMachineWindow *pMachineWindow);
+    void cleanupListener(ulong uIndex);
 
     /* Commands to capture/release mouse: */
@@ -122,4 +123,6 @@
     UIMachineLogic *m_pMachineLogic;
 
+    /* Registered machine-windows(s): */
+    QMap<ulong, QWidget*> m_windows;
     /* Registered machine-view(s): */
     QMap<ulong, UIMachineView*> m_views;
