Index: trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 46290)
+++ trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 46293)
@@ -296,4 +296,5 @@
 	src/runtime/UIActionPoolRuntime.h \
 	src/runtime/UIConsoleEventHandler.h \
+	src/runtime/UIFrameBuffer.h \
 	src/runtime/UIIndicatorsPool.h \
 	src/runtime/UIKeyboardHandler.h \
Index: trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h	(revision 46290)
+++ trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h	(revision 46293)
@@ -69,5 +69,4 @@
     {
           ResizeEventType = QEvent::User + 101
-        , RepaintEventType
         , SetRegionEventType
         , ModifierKeyChangeEventType
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp	(revision 46290)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp	(revision 46293)
@@ -47,6 +47,15 @@
 #endif
 {
+    /* Assign mahine-view: */
     AssertMsg(m_pMachineView, ("UIMachineView must not be null\n"));
     m_WinId = (m_pMachineView && m_pMachineView->viewport()) ? (LONG64)m_pMachineView->viewport()->winId() : 0;
+
+    /* Connect NotifyUpdate handler: */
+    if (m_pMachineView)
+        connect(this, SIGNAL(sigNotifyUpdate(int, int, int, int)),
+                m_pMachineView, SLOT(sltHandleNotifyUpdate(int, int, int, int)),
+                Qt::QueuedConnection);
+
+    /* Initialize critical-section: */
     int rc = RTCritSectInit(&m_critSect);
     AssertRC(rc);
@@ -177,15 +186,18 @@
 }
 
-/* This method is called on EMT from under this object's lock! */
 STDMETHODIMP UIFrameBuffer::NotifyUpdate(ULONG uX, ULONG uY, ULONG uW, ULONG uH)
 {
+    /* See comment in setView(): */
+    lock();
+
     /* QWidget::update() is NOT thread safe and seems never will be,
-     * So we have to post an async event to perform update operation.
-     * Later the event will be replaced by the corresponding signal stuff: */
-    lock(); /* See comment in setView(). */
-    if (m_pMachineView)
-        QApplication::postEvent(m_pMachineView, new UIRepaintEvent(uX, uY, uW, uH));
-    unlock();
-
+     * So we have to notify the machine-view with the async signal to perform update operation. */
+    if (m_pMachineView)
+        emit sigNotifyUpdate(uX, uY, uW, uH);
+
+    /* Unlock thread finally: */
+    unlock();
+
+    /* Confirm NotifyUpdate: */
     return S_OK;
 }
@@ -309,6 +321,21 @@
      * so I will do it anyway. */
     lock();
+
+    /* Disconnect NotifyUpdate handler: */
+    if (m_pMachineView)
+        disconnect(this, SIGNAL(sigNotifyUpdate(int, int, int, int)),
+                   m_pMachineView, SLOT(sltHandleNotifyUpdate(int, int, int, int)));
+
+    /* Reassign machine-view: */
     m_pMachineView = pView;
     m_WinId = (m_pMachineView && m_pMachineView->viewport()) ? (LONG64)m_pMachineView->viewport()->winId() : 0;
-    unlock();
-}
+
+    /* Connect NotifyUpdate handler: */
+    if (m_pMachineView)
+        connect(this, SIGNAL(sigNotifyUpdate(int, int, int, int)),
+                m_pMachineView, SLOT(sltHandleNotifyUpdate(int, int, int, int)),
+                Qt::QueuedConnection);
+
+    /* Unlock thread finally: */
+    unlock();
+}
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h	(revision 46290)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h	(revision 46293)
@@ -67,24 +67,4 @@
 
 /**
- *  Frame buffer repaint event.
- */
-class UIRepaintEvent : public QEvent
-{
-public:
-
-    UIRepaintEvent(int iX, int iY, int iW, int iH)
-        : QEvent((QEvent::Type)RepaintEventType)
-        , m_iX(iX), m_iY(iY), m_iW(iW), m_iH(iH) {}
-    int x() { return m_iX; }
-    int y() { return m_iY; }
-    int width() { return m_iW; }
-    int height() { return m_iH; }
-
-private:
-
-    int m_iX, m_iY, m_iW, m_iH;
-};
-
-/**
  *  Frame buffer set region event.
  */
@@ -124,6 +104,13 @@
  *  See IFramebuffer documentation for more info.
  */
-class UIFrameBuffer : VBOX_SCRIPTABLE_IMPL(IFramebuffer)
+class UIFrameBuffer : public QObject, VBOX_SCRIPTABLE_IMPL(IFramebuffer)
 {
+    Q_OBJECT;
+
+signals:
+
+    /* Notifiers: EMT<->GUI interthread stuff: */
+    void sigNotifyUpdate(int iX, int iY, int iW, int iH);
+
 public:
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 46290)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 46293)
@@ -203,4 +203,10 @@
     QString strKey = makeExtraDataKeyPerMonitor(GUI_LastGuestSizeHintWasFullscreen);
     machine.SetExtraData(strKey, isFullscreenOrSeamless() ? "true" : "");
+}
+
+void UIMachineView::sltHandleNotifyUpdate(int iX, int iY, int iW, int iH)
+{
+    /* Update corresponding viewport part: */
+    viewport()->update(iX - contentsX(), iY - contentsY(), iW, iH);
 }
 
@@ -916,12 +922,4 @@
     switch (pEvent->type())
     {
-        case RepaintEventType:
-        {
-            UIRepaintEvent *pPaintEvent = static_cast<UIRepaintEvent*>(pEvent);
-            viewport()->update(pPaintEvent->x() - contentsX(), pPaintEvent->y() - contentsY(),
-                                pPaintEvent->width(), pPaintEvent->height());
-            return true;
-        }
-
 #ifdef Q_WS_MAC
         /* Event posted OnShowWindow: */
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 46290)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 46293)
@@ -91,4 +91,7 @@
     /* Slot to perform guest resize: */
     void sltPerformGuestResize(const QSize &aSize = QSize());
+
+    /* Handler: Frame-buffer NotifyUpdate stuff: */
+    virtual void sltHandleNotifyUpdate(int iX, int iY, int iW, int iH);
 
     /* Watch dog for desktop resizes: */
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp	(revision 46290)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp	(revision 46293)
@@ -137,4 +137,23 @@
 }
 
+void UIMachineViewScale::sltHandleNotifyUpdate(int iX, int iY, int iW, int iH)
+{
+    /* Initialize variables for scale mode: */
+    QSize scaledSize = frameBuffer()->scaledSize();
+    double xRatio = (double)scaledSize.width() / frameBuffer()->width();
+    double yRatio = (double)scaledSize.height() / frameBuffer()->height();
+    AssertMsg(contentsX() == 0, ("This can't be, else notify Dsen!\n"));
+    AssertMsg(contentsY() == 0, ("This can't be, else notify Dsen!\n"));
+
+    /* Update corresponding viewport part,
+     * But make sure we update always a bigger rectangle than requested to
+     * catch all rounding errors. (use 1 time the ratio factor and
+     * round down on top/left, but round up for the width/height) */
+    viewport()->update((int)(iX * xRatio) - ((int)xRatio) - 1,
+                       (int)(iY * yRatio) - ((int)yRatio) - 1,
+                       (int)(iW * xRatio) + ((int)xRatio + 2) * 2,
+                       (int)(iH * yRatio) + ((int)yRatio + 2) * 2);
+}
+
 bool UIMachineViewScale::event(QEvent *pEvent)
 {
@@ -172,25 +191,5 @@
         }
 
-        case RepaintEventType:
-        {
-            UIRepaintEvent *pPaintEvent = static_cast<UIRepaintEvent*>(pEvent);
-            QSize scaledSize = frameBuffer()->scaledSize();
-            double xRatio = (double)scaledSize.width() / frameBuffer()->width();
-            double yRatio = (double)scaledSize.height() / frameBuffer()->height();
-            AssertMsg(contentsX() == 0, ("This can't be, else notify Dsen!\n"));
-            AssertMsg(contentsY() == 0, ("This can't be, else notify Dsen!\n"));
-
-            /* Make sure we update always a bigger rectangle than requested to
-             * catch all rounding errors. (use 1 time the ratio factor and
-             * round down on top/left, but round up for the width/height) */
-            viewport()->update((int)(pPaintEvent->x() * xRatio) - ((int)xRatio) - 1,
-                               (int)(pPaintEvent->y() * yRatio) - ((int)yRatio) - 1,
-                               (int)(pPaintEvent->width() * xRatio) + ((int)xRatio + 2) * 2,
-                               (int)(pPaintEvent->height() * yRatio) + ((int)yRatio + 2) * 2);
-            pEvent->accept();
-            return true;
-        }
-
-        default:
+         default:
             break;
     }
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h	(revision 46290)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h	(revision 46293)
@@ -49,4 +49,7 @@
     void sltPerformGuestScale();
 
+    /* Handler: Frame-buffer NotifyUpdate stuff: */
+    void sltHandleNotifyUpdate(int iX, int iY, int iW, int iH);
+
 private:
 
