Index: /trunk/src/VBox/Main/DisplayImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/DisplayImpl.cpp	(revision 35147)
+++ /trunk/src/VBox/Main/DisplayImpl.cpp	(revision 35148)
@@ -617,9 +617,9 @@
  */
 int Display::handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM,
-                                  uint32_t cbLine, int w, int h)
+                                  uint32_t cbLine, int w, int h, uint16_t flags)
 {
     LogRel (("Display::handleDisplayResize(): uScreenId = %d, pvVRAM=%p "
-             "w=%d h=%d bpp=%d cbLine=0x%X\n",
-             uScreenId, pvVRAM, w, h, bpp, cbLine));
+             "w=%d h=%d bpp=%d cbLine=0x%X, flags=0x%X\n",
+             uScreenId, pvVRAM, w, h, bpp, cbLine, flags));
 
     /* If there is no framebuffer, this call is not interesting. */
@@ -635,4 +635,5 @@
     mLastWidth = w;
     mLastHeight = h;
+    mLastFlags = flags;
 
     ULONG pixelFormat;
@@ -675,4 +676,5 @@
         maFramebuffers[uScreenId].pendingResize.w           = w;
         maFramebuffers[uScreenId].pendingResize.h           = h;
+        maFramebuffers[uScreenId].pendingResize.flags       = flags;
 
         return VINF_VGA_RESIZE_IN_PROGRESS;
@@ -739,5 +741,5 @@
             pFBInfo->pendingResize.fPending = false;
             handleDisplayResize (uScreenId, pFBInfo->pendingResize.bpp, pFBInfo->pendingResize.pvVRAM,
-                                 pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h);
+                                 pFBInfo->pendingResize.cbLine, pFBInfo->pendingResize.w, pFBInfo->pendingResize.h, pFBInfo->pendingResize.flags);
             continue;
         }
@@ -946,12 +948,22 @@
     if (!mpDrv)
         return;
-    x2 = mpDrv->IConnector.cx + maFramebuffers[0].xOrigin;
-    y2 = mpDrv->IConnector.cy + maFramebuffers[0].yOrigin;
+    /* If VBVA is not in use then maFramebuffers will be zeroed out and this
+     * will still work as it should. */
+    if (!(maFramebuffers[0].flags & VBVA_SCREEN_F_DISABLED))
+    {
+        x2 = mpDrv->IConnector.cx + (int32_t)maFramebuffers[0].xOrigin;
+        y2 = mpDrv->IConnector.cy + (int32_t)maFramebuffers[0].yOrigin;
+    }
     for (unsigned i = 1; i < mcMonitors; ++i)
     {
-        x1 = RT_MIN(x1, maFramebuffers[i].xOrigin);
-        y1 = RT_MIN(y1, maFramebuffers[i].yOrigin);
-        x2 = RT_MAX(x2, maFramebuffers[i].xOrigin + (int32_t)maFramebuffers[i].w);
-        y2 = RT_MAX(y2, maFramebuffers[i].yOrigin + (int32_t)maFramebuffers[i].h);
+        if (!(maFramebuffers[i].flags & VBVA_SCREEN_F_DISABLED))
+        {
+            x1 = RT_MIN(x1, maFramebuffers[i].xOrigin);
+            y1 = RT_MIN(y1, maFramebuffers[i].yOrigin);
+            x2 = RT_MAX(x2,   maFramebuffers[i].xOrigin
+                            + (int32_t)maFramebuffers[i].w);
+            y2 = RT_MAX(y2,   maFramebuffers[i].yOrigin
+                            + (int32_t)maFramebuffers[i].h);
+        }
     }
     *px1 = x1;
@@ -2992,5 +3004,6 @@
                                       pFBInfo->u32LineSize,
                                       pFBInfo->w,
-                                      pFBInfo->h);
+                                      pFBInfo->h,
+                                      pFBInfo->flags);
         }
         else if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
@@ -3001,5 +3014,6 @@
                                       that->mLastBytesPerLine,
                                       that->mLastWidth,
-                                      that->mLastHeight);
+                                      that->mLastHeight,
+                                      that->mLastFlags);
         }
     }
@@ -3022,5 +3036,5 @@
                   bpp, pvVRAM, cbLine, cx, cy));
 
-    return pDrv->pDisplay->handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy);
+    return pDrv->pDisplay->handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy, VBVA_SCREEN_F_ACTIVE);
 }
 
@@ -3434,5 +3448,5 @@
             {
                 /* Primary screen resize is initiated by the VGA device. */
-                pDrv->pDisplay->handleDisplayResize(uScreenId, pScreen->bitsPerPixel, (uint8_t *)pvVRAM + pFBInfo->u32Offset, pScreen->u32LineSize, pScreen->u16Width, pScreen->u16Height);
+                pDrv->pDisplay->handleDisplayResize(uScreenId, pScreen->bitsPerPixel, (uint8_t *)pvVRAM + pFBInfo->u32Offset, pScreen->u32LineSize, pScreen->u16Width, pScreen->u16Height, VBVA_SCREEN_F_ACTIVE);
             }
         }
@@ -3859,4 +3873,6 @@
     pFBInfo->u32LineSize = pScreen->u32LineSize;
 
+    pFBInfo->flags = pScreen->u16Flags;
+
     if (fNewOrigin)
     {
@@ -3899,5 +3915,5 @@
     return pThis->handleDisplayResize(pScreen->u32ViewIndex, pScreen->u16BitsPerPixel,
                                       (uint8_t *)pvVRAM + pScreen->u32StartOffset,
-                                      pScreen->u32LineSize, pScreen->u32Width, pScreen->u32Height);
+                                      pScreen->u32LineSize, pScreen->u32Width, pScreen->u32Height, pScreen->u16Flags);
 }
 
Index: /trunk/src/VBox/Main/include/DisplayImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/DisplayImpl.h	(revision 35147)
+++ /trunk/src/VBox/Main/include/DisplayImpl.h	(revision 35148)
@@ -53,4 +53,6 @@
     uint32_t u32LineSize;
 
+    uint16_t flags;
+
     VBOXVIDEOINFOHOSTEVENTS *pHostEvents;
 
@@ -76,4 +78,5 @@
         int w;
         int h;
+        uint16_t flags;
     } pendingResize;
 
@@ -122,5 +125,5 @@
 
     // public methods only for internal purposes
-    int handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM, uint32_t cbLine, int w, int h);
+    int handleDisplayResize (unsigned uScreenId, uint32_t bpp, void *pvVRAM, uint32_t cbLine, int w, int h, uint16_t flags);
     void handleDisplayUpdateLegacy (int x, int y, int cx, int cy);
     void handleDisplayUpdate (unsigned uScreenId, int x, int y, int w, int h);
@@ -243,4 +246,5 @@
     int mLastWidth;
     int mLastHeight;
+    uint16_t mLastFlags;
 
     VBVAMEMORY *mpVbvaMemory;
