Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h	(revision 54099)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h	(revision 54100)
@@ -1906,7 +1906,7 @@
     }
 
-    void resizeEvent(int iWidth, int iHeight)
-    {
-        UIFrameBuffer::resizeEvent(iWidth, iHeight);
+    void performResize(int iWidth, int iHeight)
+    {
+        UIFrameBuffer::performResize(iWidth, iHeight);
         mOverlay.onResizeEventPostprocess(VBoxFBSizeInfo(this),
                 QPoint(mpView->contentsX(), mpView->contentsY()));
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp	(revision 54099)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp	(revision 54100)
@@ -93,5 +93,5 @@
 
     /* Resize frame-buffer to default size: */
-    resizeEvent(640, 480);
+    performResize(640, 480);
 
 #ifdef Q_OS_WIN
@@ -571,7 +571,7 @@
 }
 
-void UIFrameBuffer::notifyChange(int iWidth, int iHeight)
-{
-    LogRel(("UIFrameBuffer::notifyChange: Size=%dx%d\n", iWidth, iHeight));
+void UIFrameBuffer::handleNotifyChange(int iWidth, int iHeight)
+{
+    LogRel(("UIFrameBuffer::handleNotifyChange: Size=%dx%d\n", iWidth, iHeight));
 
     /* Make sure machine-view is assigned: */
@@ -585,5 +585,5 @@
     {
         /* Do nothing, change-event already processed: */
-        LogRel2(("UIFrameBuffer::notifyChange: Already processed.\n"));
+        LogRel2(("UIFrameBuffer::handleNotifyChange: Already processed.\n"));
         /* Unlock access to frame-buffer: */
         unlock();
@@ -600,10 +600,69 @@
 
     /* Perform frame-buffer resize: */
-    resizeEvent(iWidth, iHeight);
-}
-
-void UIFrameBuffer::resizeEvent(int iWidth, int iHeight)
-{
-    LogRel(("UIFrameBuffer::resizeEvent: Size=%dx%d\n", iWidth, iHeight));
+    performResize(iWidth, iHeight);
+}
+
+void UIFrameBuffer::handlePaintEvent(QPaintEvent *pEvent)
+{
+    LogRel2(("UIFrameBuffer::handlePaintEvent: Origin=%lux%lu, Size=%dx%d\n",
+             pEvent->rect().x(), pEvent->rect().y(),
+             pEvent->rect().width(), pEvent->rect().height()));
+
+    /* On mode switch the enqueued paint-event may still come
+     * while the machine-view is already null (before the new machine-view set),
+     * ignore paint-event in that case. */
+    if (!m_pMachineView)
+        return;
+
+    /* Lock access to frame-buffer: */
+    lock();
+
+    /* But if updates disabled: */
+    if (!m_fUpdatesAllowed)
+    {
+        /* Unlock access to frame-buffer: */
+        unlock();
+        /* And return immediately: */
+        return;
+    }
+
+    /* Depending on visual-state type: */
+    switch (m_pMachineView->machineLogic()->visualStateType())
+    {
+        case UIVisualStateType_Seamless:
+            paintSeamless(pEvent);
+            break;
+        default:
+            paintDefault(pEvent);
+            break;
+    }
+
+    /* Unlock access to frame-buffer: */
+    unlock();
+}
+
+void UIFrameBuffer::handleSetVisibleRegion(const QRegion &region)
+{
+    /* Make sure async visible-region has changed: */
+    if (m_asyncVisibleRegion == region)
+        return;
+
+    /* We are accounting async visible-regions one-by-one
+     * to keep corresponding viewport area always updated! */
+    if (!m_asyncVisibleRegion.isEmpty())
+        m_pMachineView->viewport()->update(m_asyncVisibleRegion - region);
+
+    /* Remember last visible region: */
+    m_asyncVisibleRegion = region;
+
+#ifdef VBOX_WITH_MASKED_SEAMLESS
+    /* We have to use async visible-region to apply to [Q]Widget [set]Mask: */
+    m_pMachineView->machineWindow()->setMask(m_asyncVisibleRegion);
+#endif /* VBOX_WITH_MASKED_SEAMLESS */
+}
+
+void UIFrameBuffer::performResize(int iWidth, int iHeight)
+{
+    LogRel(("UIFrameBuffer::performResize: Size=%dx%d\n", iWidth, iHeight));
 
     /* Make sure machine-view is assigned: */
@@ -623,5 +682,5 @@
     if (m_sourceBitmap.isNull())
     {
-        LogRel(("UIFrameBuffer::resizeEvent: "
+        LogRel(("UIFrameBuffer::performResize: "
                 "Using FALLBACK buffer due to source-bitmap is not provided..\n"));
 
@@ -637,5 +696,5 @@
     else
     {
-        LogRel(("UIFrameBuffer::resizeEvent: "
+        LogRel(("UIFrameBuffer::performResize: "
                 "Directly using source-bitmap content\n"));
 
@@ -667,5 +726,5 @@
         LONG yOrigin = 0;
         KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
-        CDisplay display = m_pMachineView->uisession()->session().GetConsole().GetDisplay();
+        CDisplay display = m_pMachineView->uisession()->display();
         display.GetScreenResolution(m_pMachineView->screenId(),
                                     ulWidth, ulHeight, ulGuestBitsPerPixel, xOrigin, yOrigin, monitorStatus);
@@ -695,5 +754,5 @@
 
         /* And send async-signal to update asynchronous one: */
-        LogRel2(("UIFrameBuffer::resizeEvent: Rectangle count=%lu, Sending to async-handler\n",
+        LogRel2(("UIFrameBuffer::performResize: Rectangle count=%lu, Sending to async-handler\n",
                  (unsigned long)m_syncVisibleRegion.rectCount()));
         emit sigSetVisibleRegion(m_syncVisibleRegion);
@@ -705,63 +764,4 @@
     if (m_pMachineView->machineLogic()->visualStateType() != UIVisualStateType_Scale)
         setScaledSize(scaleFactor() == 1.0 ? QSize() : QSize((int)(m_iWidth * scaleFactor()), (int)(m_iHeight * scaleFactor())));
-}
-
-void UIFrameBuffer::paintEvent(QPaintEvent *pEvent)
-{
-    LogRel2(("UIFrameBuffer::paintEvent: Origin=%lux%lu, Size=%dx%d\n",
-             pEvent->rect().x(), pEvent->rect().y(),
-             pEvent->rect().width(), pEvent->rect().height()));
-
-    /* On mode switch the enqueued paint-event may still come
-     * while the machine-view is already null (before the new machine-view set),
-     * ignore paint-event in that case. */
-    if (!m_pMachineView)
-        return;
-
-    /* Lock access to frame-buffer: */
-    lock();
-
-    /* But if updates disabled: */
-    if (!m_fUpdatesAllowed)
-    {
-        /* Unlock access to frame-buffer: */
-        unlock();
-        /* And return immediately: */
-        return;
-    }
-
-    /* Depending on visual-state type: */
-    switch (m_pMachineView->machineLogic()->visualStateType())
-    {
-        case UIVisualStateType_Seamless:
-            paintSeamless(pEvent);
-            break;
-        default:
-            paintDefault(pEvent);
-            break;
-    }
-
-    /* Unlock access to frame-buffer: */
-    unlock();
-}
-
-void UIFrameBuffer::applyVisibleRegion(const QRegion &region)
-{
-    /* Make sure async visible-region has changed: */
-    if (m_asyncVisibleRegion == region)
-        return;
-
-    /* We are accounting async visible-regions one-by-one
-     * to keep corresponding viewport area always updated! */
-    if (!m_asyncVisibleRegion.isEmpty())
-        m_pMachineView->viewport()->update(m_asyncVisibleRegion - region);
-
-    /* Remember last visible region: */
-    m_asyncVisibleRegion = region;
-
-#ifdef VBOX_WITH_MASKED_SEAMLESS
-    /* We have to use async visible-region to apply to [Q]Widget [set]Mask: */
-    m_pMachineView->machineWindow()->setMask(m_asyncVisibleRegion);
-#endif /* VBOX_WITH_MASKED_SEAMLESS */
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h	(revision 54099)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h	(revision 54100)
@@ -200,11 +200,12 @@
 
     /** Handles frame-buffer notify-change-event. */
-    virtual void notifyChange(int iWidth, int iHeight);
-    /** Handles frame-buffer resize-event. */
-    virtual void resizeEvent(int iWidth, int iHeight);
+    virtual void handleNotifyChange(int iWidth, int iHeight);
     /** Handles frame-buffer paint-event. */
-    virtual void paintEvent(QPaintEvent *pEvent);
-    /** Handles frame-buffer apply-visible-region-event. */
-    virtual void applyVisibleRegion(const QRegion &region);
+    virtual void handlePaintEvent(QPaintEvent *pEvent);
+    /** Handles frame-buffer set-visible-region-event. */
+    virtual void handleSetVisibleRegion(const QRegion &region);
+
+    /** Performs frame-buffer resizing. */
+    virtual void performResize(int iWidth, int iHeight);
 
 #ifdef VBOX_WITH_VIDEOHWACCEL
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 54099)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 54100)
@@ -218,6 +218,6 @@
 void UIMachineView::sltHandleNotifyChange(int iWidth, int iHeight)
 {
-    LogRelFlow(("UIMachineView::HandleNotifyChange: Screen=%d, Size=%dx%d.\n",
-                (unsigned long)m_uScreenId, iWidth, iHeight));
+    LogRel(("UIMachineView::sltHandleNotifyChange: Screen=%d, Size=%dx%d.\n",
+            (unsigned long)m_uScreenId, iWidth, iHeight));
 
     // TODO: Move to appropriate place!
@@ -242,5 +242,5 @@
 
         /* Perform frame-buffer mode-change: */
-        frameBuffer()->notifyChange(iWidth, iHeight);
+        frameBuffer()->handleNotifyChange(iWidth, iHeight);
 
         /* Scale-mode doesn't need this.. */
@@ -281,5 +281,5 @@
     display().InvalidateAndUpdateScreen(m_uScreenId);
 
-    LogRelFlow(("UIMachineView::ResizeHandled: Screen=%d, Size=%dx%d.\n",
+    LogRelFlow(("UIMachineView::sltHandleNotifyChange: Complete for Screen=%d, Size=%dx%d.\n",
                 (unsigned long)m_uScreenId, iWidth, iHeight));
 }
@@ -364,5 +364,5 @@
     /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */
     sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height());
-    frameBuffer()->resizeEvent(frameBuffer()->width(), frameBuffer()->height());
+    frameBuffer()->performResize(frameBuffer()->width(), frameBuffer()->height());
     machineWindow()->normalizeGeometry(true /* adjust position */);
     adjustGuestScreenSize();
@@ -385,5 +385,5 @@
     /* Adjust frame-buffer, machine-window and guest-screen size if necessary: */
     sltHandleNotifyChange(frameBuffer()->width(), frameBuffer()->height());
-    frameBuffer()->resizeEvent(frameBuffer()->width(), frameBuffer()->height());
+    frameBuffer()->performResize(frameBuffer()->width(), frameBuffer()->height());
     machineWindow()->normalizeGeometry(true /* adjust position */);
     adjustGuestScreenSize();
@@ -600,5 +600,5 @@
         /* If we have a valid size, resize the framebuffer. */
         if (size.width() > 0 && size.height() > 0)
-            frameBuffer()->resizeEvent(size.width(), size.height());
+            frameBuffer()->performResize(size.width(), size.height());
     }
 }
@@ -1280,5 +1280,5 @@
     /* Delegate the paint function to the UIFrameBuffer interface: */
     if (m_pFrameBuffer)
-        m_pFrameBuffer->paintEvent(pPaintEvent);
+        m_pFrameBuffer->handlePaintEvent(pPaintEvent);
 #ifdef Q_WS_MAC
     /* Update the dock icon if we are in the running state: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 54099)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp	(revision 54100)
@@ -85,5 +85,5 @@
 {
     /* Apply new seamless-region: */
-    m_pFrameBuffer->applyVisibleRegion(region);
+    m_pFrameBuffer->handleSetVisibleRegion(region);
 }
 
