Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h	(revision 47622)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h	(revision 47623)
@@ -209,4 +209,6 @@
     VBOXVR_SCR_COMPOSITOR_ENTRY CEntry;
     VBOXVR_SCR_COMPOSITOR_ENTRY RootVrCEntry;
+    void *pvORInstance;
+    GLuint idPBO;
 } CR_DISPLAY_ENTRY, *PCR_DISPLAY_ENTRY;
 /**/
@@ -238,5 +240,5 @@
     GLuint aidColorTexs[2];
 
-    void *pvOutputRedirectInstance;
+    void *pvReserved;
 
     CRCreateInfo_t CreateInfo;
@@ -250,5 +252,4 @@
     GLuint idDepthStencilRB;
     GLuint fboWidth, fboHeight;
-    GLuint idPBO;
 
     GLuint cDisabled;
@@ -260,4 +261,5 @@
     GLboolean fRootVrOn;
     GLboolean fForcePresentState;
+    GLboolean fOrPresentOnReenable;
 
     GLboolean fUseDefaultDEntry;
@@ -364,4 +366,6 @@
 {
     CRHashTable * pTexIdToDemInfoMap;
+    uint32_t cEntered;
+    RTLISTNODE ReleasedList;
 } CR_DISPLAY_ENTRY_MAP, *PCR_DISPLAY_ENTRY_MAP;
 
@@ -378,6 +382,6 @@
 
 void CrHlpFreeTexImage(CRContext *pCurCtx, GLuint idPBO, void *pvData);
-void* CrHlpGetTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLuint idPBO, GLenum enmFormat);
-void CrHlpPutTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLenum enmFormat, void *pvData);
+void* CrHlpGetTexImage(CRContext *pCurCtx, const VBOXVR_TEXTURE *pTexture, GLuint idPBO, GLenum enmFormat);
+void CrHlpPutTexImage(CRContext *pCurCtx, const VBOXVR_TEXTURE *pTexture, GLenum enmFormat, void *pvData);
 
 /* */
Index: /trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h	(revision 47622)
+++ /trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h	(revision 47623)
@@ -384,5 +384,5 @@
     return VBoxVrCompositorEntryIsInList(&pEntry->Ce);
 }
-VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, uint32_t *pfChangeFlags);
+VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, VBOXVR_SCR_COMPOSITOR_ENTRY **ppReplacedScrEntry, uint32_t *pfChangeFlags);
 VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsSet(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, bool *pfChanged);
 VBOXVREGDECL(int) CrVrScrCompositorEntryListIntersect(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const VBOXVR_LIST *pList2, bool *pfChanged);
Index: /trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp	(revision 47622)
+++ /trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp	(revision 47623)
@@ -1862,5 +1862,5 @@
 
 
-static int crVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, uint32_t *pfChangedFlags)
+static int crVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, VBOXVR_SCR_COMPOSITOR_ENTRY **ppReplacedScrEntry, uint32_t *pfChangedFlags)
 {
     uint32_t fChangedFlags = 0;
@@ -1900,4 +1900,8 @@
     if (pfChangedFlags)
         *pfChangedFlags = fChangedFlags;
+
+    if (ppReplacedScrEntry)
+        *ppReplacedScrEntry = pReplacedScrEntry;
+
     return VINF_SUCCESS;
 }
@@ -1987,5 +1991,5 @@
 }
 
-VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, uint32_t *pfChangeFlags)
+VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsAdd(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated, VBOXVR_SCR_COMPOSITOR_ENTRY **ppReplacedScrEntry, uint32_t *pfChangeFlags)
 {
     int rc;
@@ -2028,5 +2032,5 @@
     }
 
-    rc = crVrScrCompositorEntryRegionsAdd(pCompositor, pEntry, cRegions, paRegions, &fChangeFlags);
+    rc = crVrScrCompositorEntryRegionsAdd(pCompositor, pEntry, cRegions, paRegions, ppReplacedScrEntry, &fChangeFlags);
     if (!RT_SUCCESS(rc))
     {
@@ -2054,4 +2058,6 @@
     if (fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED)
         fPosChanged = false;
+    else if (ppReplacedScrEntry)
+        *ppReplacedScrEntry = NULL;
 
     if (pfChangeFlags)
Index: /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h	(revision 47622)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h	(revision 47623)
@@ -129,5 +129,7 @@
 CRMuralInfo * crServerGetDummyMural(GLint visualBits);
 
-void crServerSetupOutputRedirect(CRMuralInfo *mural);
+void crServerPresentOutputRedirect(CRMuralInfo *pMural);
+void crServerOutputRedirectCheckEnableDisable(CRMuralInfo *pMural);
+
 void crServerCheckMuralGeometry(CRMuralInfo *mural);
 GLboolean crServerSupportRedirMuralFBO(void);
@@ -422,5 +424,5 @@
 void CrDpEntryCleanup(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry);
 int CrDpEntryRegionsSet(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
-int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
+int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, CR_DISPLAY_ENTRY_MAP *pMap);
 void CrDpEntryRegionsClear(PCR_DISPLAY pDisplay);
 DECLINLINE(bool) CrDpEntryIsUsed(PCR_DISPLAY_ENTRY pEntry)
@@ -436,4 +438,6 @@
 int CrDemGlobalInit();
 void CrDemTeGlobalTerm();
+void CrDemEnter(PCR_DISPLAY_ENTRY_MAP pMap);
+void CrDemLeave(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY pNewEntry, PCR_DISPLAY_ENTRY pReplacedEntry);
 int CrDemInit(PCR_DISPLAY_ENTRY_MAP pMap);
 void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap);
@@ -445,4 +449,15 @@
 int crServerDisplaySaveState(PSSMHANDLE pSSM);
 int crServerDisplayLoadState(PSSMHANDLE pSSM, uint32_t u32Version);
+
+
+void crServerDEntryResized(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
+void crServerDEntryMoved(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
+void crServerDEntryVibleRegions(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry);
+void crServerDEntryCheckFBO(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry, CRContext *ctx);
+void crServerDEntryCleanup(CR_DISPLAY_ENTRY *pDEntry);
+
+void crServerDEntryAllResized(CRMuralInfo *pMural);
+void crServerDEntryAllMoved(CRMuralInfo *pMural);
+void crServerDEntryAllVibleRegions(CRMuralInfo *pMural);
 
 //#define VBOX_WITH_CRSERVER_DUMPER
Index: /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c	(revision 47622)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c	(revision 47623)
@@ -2957,5 +2957,11 @@
     CRMuralInfo *mural = (CRMuralInfo*) data1;
 
-    crServerSetupOutputRedirect(mural);
+    if (!mural->CreateInfo.externalID)
+        return;
+
+    if (cr_server.bUseOutputRedirect)
+        crServerPresentOutputRedirect(mural);
+    else
+        crServerOutputRedirectCheckEnableDisable(mural);
 }
 
Index: /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c	(revision 47622)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.c	(revision 47623)
@@ -47,14 +47,143 @@
 }
 
+void crServerDEntryResized(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry)
+{
+    /*PBO*/
+    if (pDEntry->idPBO)
+    {
+        CRASSERT(cr_server.bUsePBOForReadback);
+        cr_server.head_spu->dispatch_table.DeleteBuffersARB(1, &pDEntry->idPBO);
+        pDEntry->idPBO = 0;
+    }
+
+    if (pDEntry->pvORInstance)
+    {
+        cr_server.outputRedirect.CRORGeometry(pDEntry->pvORInstance,
+                                                pMural->hX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x,
+                                                pMural->hY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y,
+                                                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width,
+                                                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
+
+        crServerDEntryVibleRegions(pMural, pDEntry);
+    }
+}
+
+void crServerDEntryMoved(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry)
+{
+    if (pDEntry->pvORInstance)
+    {
+        cr_server.outputRedirect.CRORGeometry(pDEntry->pvORInstance,
+                                                pMural->hX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x,
+                                                pMural->hY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y,
+                                                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width,
+                                                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
+
+        crServerDEntryVibleRegions(pMural, pDEntry);
+    }
+
+}
+
+void crServerDEntryCleanup(CR_DISPLAY_ENTRY *pDEntry)
+{
+    if (pDEntry->pvORInstance)
+    {
+        cr_server.outputRedirect.CROREnd(pDEntry->pvORInstance);
+        pDEntry->pvORInstance = NULL;
+    }
+}
+
+void crServerDEntryVibleRegions(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry)
+{
+    if (pDEntry->pvORInstance)
+    {
+        uint32_t cRects;
+        const RTRECT *pRects;
+
+        int rc = CrVrScrCompositorEntryRegionsGet(&pMural->Compositor, &pDEntry->CEntry, &cRects, NULL, &pRects, NULL);
+        if (!RT_SUCCESS(rc))
+        {
+            crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc);
+            return;
+        }
+
+        cr_server.outputRedirect.CRORVisibleRegion(pDEntry->pvORInstance, cRects, pRects);
+    }
+}
+
+/***/
+void crServerDEntryAllResized(CRMuralInfo *pMural)
+{
+    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
+    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
+
+    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
+    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
+    {
+        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
+        crServerDEntryResized(pMural, pDEntry);
+    }
+}
+
+void crServerDEntryAllMoved(CRMuralInfo *pMural)
+{
+    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
+    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
+
+    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
+
+    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
+    {
+        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
+        crServerDEntryMoved(pMural, pDEntry);
+    }
+}
+
+void crServerDEntryAllVibleRegions(CRMuralInfo *pMural)
+{
+    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
+    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
+
+    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
+
+    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
+    {
+        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
+        crServerDEntryVibleRegions(pMural, pDEntry);
+    }
+}
+/**/
+
+void crServerDEntryCheckFBO(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry, CRContext *ctx)
+{
+    if (!cr_server.bUsePBOForReadback == !pDEntry->idPBO)
+        return;
+
+    if (cr_server.bUsePBOForReadback)
+    {
+        Assert(!pDEntry->idPBO);
+        cr_server.head_spu->dispatch_table.GenBuffersARB(1, &pDEntry->idPBO);
+        cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pDEntry->idPBO);
+        cr_server.head_spu->dispatch_table.BufferDataARB(GL_PIXEL_PACK_BUFFER_ARB,
+                CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width*CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height*4,
+                0, GL_STREAM_READ_ARB);
+        cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, ctx->bufferobject.packBuffer->hwid);
+
+        if (!pDEntry->idPBO)
+        {
+            crWarning("PBO create failed");
+        }
+    }
+}
+
 /* Called when a new CRMuralInfo is created
  * or when OutputRedirect status is changed.
  */
-void crServerSetupOutputRedirect(CRMuralInfo *mural)
+void crServerSetupOutputRedirectEntry(CRMuralInfo *mural, CR_DISPLAY_ENTRY *pDEntry)
 {
     /* Unset the previous redirect. */
-    if (mural->pvOutputRedirectInstance)
-    {
-        cr_server.outputRedirect.CROREnd(mural->pvOutputRedirectInstance);
-        mural->pvOutputRedirectInstance = NULL;
+    if (pDEntry->pvORInstance)
+    {
+        cr_server.outputRedirect.CROREnd(pDEntry->pvORInstance);
+        pDEntry->pvORInstance = NULL;
     }
 
@@ -76,5 +205,5 @@
                 {
                     cr_server.outputRedirect.CRORBegin(cr_server.outputRedirect.pvContext,
-                                                       &mural->pvOutputRedirectInstance,
+                                                       &pDEntry->pvORInstance,
                                                        "H3DOR_FMT_RGBA_TOPDOWN"); // @todo from a header
                 }
@@ -85,10 +214,10 @@
 
         /* If this is not NULL then there was a supported format. */
-        if (mural->pvOutputRedirectInstance)
+        if (pDEntry->pvORInstance)
         {
             uint32_t cRects;
             const RTRECT *pRects;
 
-            int rc = CrVrScrCompositorRegionsGet(&mural->Compositor, &cRects, NULL, &pRects, NULL);
+            int rc = CrVrScrCompositorEntryRegionsGet(&mural->Compositor, &pDEntry->CEntry, &cRects, NULL, &pRects, NULL);
             if (!RT_SUCCESS(rc))
             {
@@ -97,12 +226,13 @@
             }
 
-            cr_server.outputRedirect.CRORGeometry(mural->pvOutputRedirectInstance,
-                                                  mural->hX, mural->hY,
-                                                  mural->width, mural->height);
-            // @todo the code assumes that RTRECT == four of GLInts
-            cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance,
-                                                       mural->cVisibleRects, (RTRECT *)mural->pVisibleRects);
-
-            crServerPresentFBO(mural);
+            cr_server.outputRedirect.CRORGeometry(pDEntry->pvORInstance,
+                                                  mural->hX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x,
+                                                  mural->hY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y,
+                                                  CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width,
+                                                  CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
+
+            cr_server.outputRedirect.CRORVisibleRegion(pDEntry->pvORInstance, cRects, pRects);
+//!!
+//            crServerPresentFBO(mural);
         }
     }
@@ -264,11 +394,4 @@
     }
 
-    if (mural->pvOutputRedirectInstance)
-    {
-        cr_server.outputRedirect.CRORGeometry(mural->pvOutputRedirectInstance,
-                                              mural->hX, mural->hY,
-                                              mural->width, mural->height);
-    }
-
     crServerVBoxCompositionDisableLeave(mural, GL_FALSE);
 }
@@ -290,5 +413,5 @@
 }
 
-static void crServerPresentMuralVRAM(CRMuralInfo *mural, char *pixels);
+static void crServerDentryPresentVRAM(CRMuralInfo *mural, CR_DISPLAY_ENTRY *pDEntry, char *pixels);
 
 #define CR_SERVER_MURAL_FROM_RPW_ENTRY(_pEntry) ((CRMuralInfo*)(((uint8_t*)(_pEntry)) - RT_OFFSETOF(CRMuralInfo, RpwEntry)))
@@ -299,6 +422,6 @@
 
     Assert(&pMural->RpwEntry == pEntry);
-
-    crServerPresentMuralVRAM(pMural, pvEntryTexData);
+    crError("port me!");
+    //    crServerPresentMuralVRAM(pMural, pvEntryTexData);
 }
 
@@ -420,5 +543,5 @@
         }
 
-        if (mural->aidFBOs[0]==0)
+        if (mural->fUseDefaultDEntry && mural->aidFBOs[0]==0)
         {
             crServerCreateMuralFBO(mural);
@@ -543,4 +666,7 @@
     }
 
+    mural->iCurDrawBuffer = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.drawBuffer);
+    mural->iCurReadBuffer = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.readBuffer);
+
     mural->fboWidth = mural->width;
     mural->fboHeight = mural->height;
@@ -548,18 +674,4 @@
     mural->iCurDrawBuffer = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.drawBuffer);
     mural->iCurReadBuffer = crServerMuralFBOIdxFromBufferName(mural, ctx->buffer.readBuffer);
-
-    /*PBO*/
-    if (cr_server.bUsePBOForReadback)
-    {
-        gl->GenBuffersARB(1, &mural->idPBO);
-        gl->BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, mural->idPBO);
-        gl->BufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, mural->width*mural->height*4, 0, GL_STREAM_READ_ARB);
-        gl->BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, ctx->bufferobject.packBuffer->hwid);
-
-        if (!mural->idPBO)
-        {
-            crWarning("PBO create failed");
-        }
-    }
 
     /*Restore gl state*/
@@ -619,11 +731,4 @@
             mural->aidFBOs[i] = 0;
         }
-    }
-
-    if (mural->idPBO!=0)
-    {
-        CRASSERT(cr_server.bUsePBOForReadback);
-        cr_server.head_spu->dispatch_table.DeleteBuffersARB(1, &mural->idPBO);
-        mural->idPBO = 0;
     }
 
@@ -649,10 +754,14 @@
 }
 
-static GLboolean crServerIntersectScreen(CRMuralInfo *mural, int sId, CRrecti *rect)
-{
-    rect->x1 = MAX(mural->gX, cr_server.screen[sId].x);
-    rect->x2 = MIN(mural->gX+(int)mural->fboWidth, cr_server.screen[sId].x+(int)cr_server.screen[sId].w);
-    rect->y1 = MAX(mural->gY, cr_server.screen[sId].y);
-    rect->y2 = MIN(mural->gY+(int)mural->fboHeight, cr_server.screen[sId].y+(int)cr_server.screen[sId].h);
+static GLboolean crServerIntersectScreen(CRMuralInfo *mural, CR_DISPLAY_ENTRY *pDEntry, int sId, CRrecti *rect)
+{
+    rect->x1 = MAX(mural->gX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x, cr_server.screen[sId].x);
+    rect->x2 = MIN(mural->gX + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x
+            + (int)CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width,
+            cr_server.screen[sId].x+(int)cr_server.screen[sId].w);
+    rect->y1 = MAX(mural->gY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y, cr_server.screen[sId].y);
+    rect->y2 = MIN(mural->gY + CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y
+            + (int)CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height,
+            cr_server.screen[sId].y+(int)cr_server.screen[sId].h);
 
     return (rect->x2>rect->x1) && (rect->y2>rect->y1);
@@ -727,8 +836,13 @@
 }
 
-static void crServerVBoxCompositionReenable(CRMuralInfo *mural, GLboolean fForcePresent)
-{
-    if (!(mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)
-            || (mural->fUseDefaultDEntry && !(mural->fPresentMode & CR_SERVER_REDIR_F_FBO))
+static void crServerVBoxCompositionReenable(CRMuralInfo *mural)
+{
+    GLboolean fForcePresent = mural->fForcePresentState;
+    GLboolean fOrPresentOnReenable = mural->fOrPresentOnReenable;
+
+    mural->fForcePresentState = GL_FALSE;
+    mural->fOrPresentOnReenable = GL_FALSE;
+
+    if ((mural->fUseDefaultDEntry && !(mural->fPresentMode & CR_SERVER_REDIR_F_FBO))
             || !mural->fDataPresented
             || (!fForcePresent
@@ -736,5 +850,11 @@
         return;
 
-    crServerVBoxCompositionPresentPerform(mural);
+    if (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)
+        crServerVBoxCompositionPresentPerform(mural);
+
+    if (fOrPresentOnReenable
+            && cr_server.bUseOutputRedirect
+            && crServerVBoxCompositionPresentNeeded(mural))
+        crServerPresentOutputRedirect(mural);
 }
 
@@ -767,6 +887,5 @@
     if (!mural->cDisabled)
     {
-        crServerVBoxCompositionReenable(mural, mural->fForcePresentState);
-        mural->fForcePresentState = GL_FALSE;
+        crServerVBoxCompositionReenable(mural);
     }
 
@@ -807,9 +926,10 @@
 }
 
-static void crServerPresentMuralVRAM(CRMuralInfo *mural, char *pixels)
+static void crServerDentryPresentVRAM(CRMuralInfo *mural, CR_DISPLAY_ENTRY *pDEntry, char *pixels)
 {
     char *tmppixels;
     CRrecti rect, rectwr, sectr;
-    int i, j;
+    int i, rc;
+    uint32_t j;
 
     if (mural->fPresentMode & CR_SERVER_REDIR_F_FBO_RAM_VMFB)
@@ -817,32 +937,19 @@
         for (i=0; i<cr_server.screenCount; ++i)
         {
-            if (crServerIntersectScreen(mural, i, &rect))
-            {
+            if (crServerIntersectScreen(mural, pDEntry, i, &rect))
+            {
+                uint32_t cRects;
+                const RTRECT *pRects;
+
                 /* rect in window relative coords */
                 crServerTransformRect(&rectwr, &rect, -mural->gX, -mural->gY);
 
-                if (!mural->pVisibleRects)
+                rc = CrVrScrCompositorEntryRegionsGet(&mural->Compositor, &pDEntry->CEntry, &cRects, NULL, &pRects, NULL);
+                if (RT_SUCCESS(rc))
                 {
                     /*we don't get any rects info for guest compiz windows, so we treat windows as visible unless explicitly received 0 visible rects*/
-                    if (!mural->bReceivedRects)
+                    for (j=0; j<cRects; ++j)
                     {
-                        tmppixels = crAlloc(4*(rect.x2-rect.x1)*(rect.y2-rect.y1));
-                        if (!tmppixels)
-                        {
-                            crWarning("Out of memory in crServerPresentFBO");
-                            crFree(pixels);
-                            return;
-                        }
-
-                        crServerCopySubImage(tmppixels, pixels, &rectwr, mural->fboWidth, mural->fboHeight);
-                        /*Note: pfnPresentFBO would free tmppixels*/
-                        cr_server.pfnPresentFBO(tmppixels, i, rect.x1-cr_server.screen[i].x, rect.y1-cr_server.screen[i].y, rect.x2-rect.x1, rect.y2-rect.y1);
-                    }
-                }
-                else
-                {
-                    for (j=0; j<mural->cVisibleRects; ++j)
-                    {
-                        if (crServerIntersectRect(&rectwr, (CRrecti*) &mural->pVisibleRects[4*j], &sectr))
+                        if (crServerIntersectRect(&rectwr, (CRrecti*)&pRects[j], &sectr))
                         {
                             tmppixels = crAlloc(4*(sectr.x2-sectr.x1)*(sectr.y2-sectr.y1));
@@ -854,57 +961,52 @@
                             }
 
-                            crServerCopySubImage(tmppixels, pixels, &sectr, mural->fboWidth, mural->fboHeight);
+                            crServerCopySubImage(tmppixels, pixels, &sectr, CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width, CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
                             /*Note: pfnPresentFBO would free tmppixels*/
                             cr_server.pfnPresentFBO(tmppixels, i,
-                                                    sectr.x1+mural->gX-cr_server.screen[i].x,
-                                                    sectr.y1+mural->gY-cr_server.screen[i].y,
+                                                    sectr.x1+mural->gX+CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->x-cr_server.screen[i].x,
+                                                    sectr.y1+mural->gY+CrVrScrCompositorEntryPosGet(&pDEntry->CEntry)->y-cr_server.screen[i].y,
                                                     sectr.x2-sectr.x1, sectr.y2-sectr.y1);
                         }
                     }
                 }
-            }
-        }
-    }
-
-    if (mural->pvOutputRedirectInstance)
+                else
+                {
+                    crWarning("CrVrScrCompositorEntryRegionsGet failed, rc %d", rc);
+                }
+            }
+        }
+    }
+
+    if (pDEntry->pvORInstance)
     {
         /* @todo find out why presentfbo is not called but crorframe is called. */
-        cr_server.outputRedirect.CRORFrame(mural->pvOutputRedirectInstance,
+        cr_server.outputRedirect.CRORFrame(pDEntry->pvORInstance,
                                            pixels,
-                                           4 * mural->fboWidth * mural->fboHeight);
-    }
-}
-
-void crServerPresentFBO(CRMuralInfo *mural)
+                                           4 * CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->width * CrVrScrCompositorEntryTexGet(&pDEntry->CEntry)->height);
+    }
+}
+
+void crServerPresentOutputRedirectEntry(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry)
 {
     char *pixels=NULL;
     GLuint idPBO;
     CRContext *ctx = crStateGetCurrent();
-    VBOXVR_TEXTURE Tex;
-
-    CRASSERT(mural->fPresentMode & CR_SERVER_REDIR_F_FBO);
-    CRASSERT(cr_server.pfnPresentFBO || (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY));
-
-    if (!crServerVBoxCompositionPresentNeeded(mural))
-        return;
-
-    if (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)
-    {
-        crServerVBoxCompositionPresentPerform(mural);
-    }
-
-    mural->fDataPresented = GL_TRUE;
-
-    if (!(mural->fPresentMode & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM))
-        return;
-
-    Tex.width = mural->width;
-    Tex.height = mural->height;
-    Tex.target = GL_TEXTURE_2D;
-    Tex.hwid = mural->aidColorTexs[CR_SERVER_FBO_FB_IDX(mural)];
-    CRASSERT(Tex.hwid);
-
-    if (mural->fPresentMode & CR_SERVER_REDIR_F_FBO_RPW)
-    {
+
+    if (!pDEntry->pvORInstance)
+    {
+        crServerSetupOutputRedirectEntry(pMural, pDEntry);
+        if (!pDEntry->pvORInstance)
+        {
+            crWarning("crServerSetupOutputRedirectEntry failed!");
+            return;
+        }
+    }
+
+    crServerDEntryCheckFBO(pMural, pDEntry, ctx);
+
+    if (pMural->fPresentMode & CR_SERVER_REDIR_F_FBO_RPW)
+    {
+        crError("port me!");
+#if 0
         /* 1. blit to RPW entry draw texture */
         CRMuralInfo *pCurrentMural = cr_server.currentMural;
@@ -972,20 +1074,16 @@
         }
 #endif
+#endif
         return;
     }
 
-    if (cr_server.bUsePBOForReadback && !mural->idPBO)
+    if (cr_server.bUsePBOForReadback && !pDEntry->idPBO)
     {
         crWarning("Mural doesn't have PBO even though bUsePBOForReadback is set!");
     }
 
-    idPBO = cr_server.bUsePBOForReadback ? mural->idPBO : 0;
-    if (idPBO)
-    {
-        CRASSERT(mural->fboWidth == mural->width);
-        CRASSERT(mural->fboHeight == mural->height);
-    }
-
-    pixels = CrHlpGetTexImage(ctx, &Tex, idPBO, GL_BGRA);
+    idPBO = cr_server.bUsePBOForReadback ? pDEntry->idPBO : 0;
+
+    pixels = CrHlpGetTexImage(ctx, CrVrScrCompositorEntryTexGet(&pDEntry->CEntry), idPBO, GL_BGRA);
     if (!pixels)
     {
@@ -994,7 +1092,52 @@
     }
 
-    crServerPresentMuralVRAM(mural, pixels);
+    crServerDentryPresentVRAM(pMural, pDEntry, pixels);
 
     CrHlpFreeTexImage(ctx, idPBO, pixels);
+}
+
+void crServerPresentOutputRedirect(CRMuralInfo *pMural)
+{
+    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
+    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
+
+    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
+
+    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
+    {
+        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
+        crServerPresentOutputRedirectEntry(pMural, pDEntry);
+    }
+}
+
+void crServerOutputRedirectCheckEnableDisable(CRMuralInfo *pMural)
+{
+    VBOXVR_SCR_COMPOSITOR_ITERATOR Iter;
+    PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
+
+    CrVrScrCompositorIterInit(&pMural->Compositor, &Iter);
+
+    while ((pEntry = CrVrScrCompositorIterNext(&Iter)) != NULL)
+    {
+        CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
+        crServerSetupOutputRedirectEntry(pMural, pDEntry);
+    }
+}
+
+void crServerPresentFBO(CRMuralInfo *mural)
+{
+    CRASSERT(mural->fPresentMode & CR_SERVER_REDIR_F_FBO);
+    CRASSERT(cr_server.pfnPresentFBO || (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY));
+
+    if (!crServerVBoxCompositionPresentNeeded(mural))
+        return;
+
+    mural->fDataPresented = GL_TRUE;
+
+    if (mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY)
+        crServerVBoxCompositionPresentPerform(mural);
+
+    if (mural->fPresentMode & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM)
+        crServerPresentOutputRedirect(mural);
 }
 
Index: /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp	(revision 47622)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp	(revision 47623)
@@ -38,29 +38,4 @@
 /* DISPLAY */
 
-//static DECLCALLBACK(int) crDpCbRegionsChanged(struct CR_PRESENTER *pPresenter)
-//{
-//    uint32_t cRegions;
-//    const RTRECT *paRegions;
-//    int rc = CrPtGetRegions(pPresenter, &cRegions, &paRegions);
-//    if (!RT_SUCCESS(rc))
-//    {
-//        crWarning("CrPtGetRegions failed, rc %d", rc);
-//        return rc;
-//    }
-//
-//    PCR_DISPLAY pDisplay = CR_DISPLAY_FROM_PRESENTER(pPresenter);
-//
-//    cr_server.head_spu->dispatch_table.WindowVisibleRegion(pDisplay->Mural.spuWindow, cRegions, (GLint*)paRegions);
-//
-//    if (pDisplay->Mural.pvOutputRedirectInstance)
-//    {
-//        /* @todo the code assumes that RTRECT == four GLInts. */
-//        cr_server.outputRedirect.CRORVisibleRegion(pDisplay->Mural.pvOutputRedirectInstance,
-//                                                        cRegions, paRegions);
-//    }
-//
-//    return VINF_SUCCESS;
-//}
-
 int CrDpInit(PCR_DISPLAY pDisplay)
 {
@@ -202,5 +177,5 @@
         }
 
-        rc = CrDpEntryRegionsAdd(pDisplay, pDEntry, &Pos, (uint32_t)cRects, (const RTRECT*)pRects);
+        rc = CrDpEntryRegionsAdd(pDisplay, pDEntry, &Pos, (uint32_t)cRects, (const RTRECT*)pRects, NULL);
         AssertRCReturn(rc, rc);
 
@@ -236,8 +211,13 @@
 }
 
-int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions)
+int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, CR_DISPLAY_ENTRY_MAP *pMap)
 {
     uint32_t fChangeFlags = 0;
-    int rc = CrVrScrCompositorEntryRegionsAdd(&pDisplay->Mural.Compositor, pEntry ? &pEntry->CEntry : NULL, pPos, cRegions, paRegions, false, &fChangeFlags);
+    VBOXVR_SCR_COMPOSITOR_ENTRY *pReplacedScrEntry = NULL;
+
+    if (pMap)
+        CrDemEnter(pMap);
+
+    int rc = CrVrScrCompositorEntryRegionsAdd(&pDisplay->Mural.Compositor, pEntry ? &pEntry->CEntry : NULL, pPos, cRegions, paRegions, false, &pReplacedScrEntry, &fChangeFlags);
     if (RT_SUCCESS(rc))
     {
@@ -251,8 +231,21 @@
             else
                 crWarning("CrVrScrCompositorRegionsGet failed, rc %d", rc);
+
+            Assert(!pReplacedScrEntry);
+        }
+        else if (fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED)
+        {
+            Assert(pReplacedScrEntry);
+        }
+        else
+        {
+            Assert(!pReplacedScrEntry);
         }
     }
     else
         crWarning("CrVrScrCompositorEntryRegionsAdd failed, rc %d", rc);
+
+    if (pMap)
+        CrDemLeave(pMap, CR_DENTRY_FROM_CENTRY(pEntry), CR_DENTRY_FROM_CENTRY(pReplacedScrEntry));
 
     return rc;
@@ -282,4 +275,5 @@
     CrVrScrCompositorEntryInit(&pEntry->RootVrCEntry, pTextureData, NULL);
     CrVrScrCompositorEntryFlagsSet(&pEntry->RootVrCEntry, fFlags);
+    pEntry->pvORInstance = NULL;
 }
 
@@ -298,4 +292,5 @@
 {
     pDisplay->Mural.fDataPresented = GL_TRUE;
+    pDisplay->Mural.fOrPresentOnReenable = GL_TRUE;
     crServerVBoxCompositionDisableLeave(&pDisplay->Mural, pDisplay->fForcePresent);
     pDisplay->fForcePresent = GL_FALSE;
@@ -313,4 +308,5 @@
     CR_DEM_ENTRY_INFO *pInfo;
     CR_DISPLAY_ENTRY_MAP *pMap;
+    RTLISTNODE Node;
 } CR_DEM_ENTRY;
 
@@ -370,4 +366,5 @@
 static void crDemEntryFree(CR_DEM_ENTRY* pDemEntry)
 {
+    crServerDEntryCleanup(&pDemEntry->Entry);
     RTMemCacheFree(g_VBoxCrDemLookasideList, pDemEntry);
 }
@@ -406,7 +403,10 @@
     }
 
-    crDemEntryFree(pDemEntry);
-
     crStateGlobalSharedRelease();
+
+    if (!pMap->cEntered)
+        crDemEntryFree(pDemEntry);
+    else
+        RTListNodeInsertAfter(&pMap->ReleasedList, &pDemEntry->Node);
 }
 
@@ -415,5 +415,8 @@
     pMap->pTexIdToDemInfoMap = crAllocHashtable();
     if (pMap->pTexIdToDemInfoMap)
+    {
+        RTListInit(&pMap->ReleasedList);
         return VINF_SUCCESS;
+    }
 
     crWarning("crAllocHashtable failed");
@@ -423,6 +426,47 @@
 void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap)
 {
+    CRASSERT(RTListIsEmpty(&pMap->ReleasedList));
+    CRASSERT(!pMap->cEntered);
     crFreeHashtable(pMap->pTexIdToDemInfoMap, NULL);
     pMap->pTexIdToDemInfoMap = NULL;
+}
+
+void CrDemEnter(PCR_DISPLAY_ENTRY_MAP pMap)
+{
+    ++pMap->cEntered;
+    Assert(pMap->cEntered);
+}
+
+void CrDemLeave(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY pNewEntry, PCR_DISPLAY_ENTRY pReplacedEntry)
+{
+    Assert(pMap->cEntered);
+    --pMap->cEntered;
+    Assert(!pReplacedEntry || pNewEntry);
+    if (pNewEntry && pReplacedEntry)
+    {
+        CR_DEM_ENTRY *pNewDemEntry = PCR_DEM_ENTRY_FROM_ENTRY(pNewEntry);
+        CR_DEM_ENTRY *pReplacedDemEntry = PCR_DEM_ENTRY_FROM_ENTRY(pReplacedEntry);
+        Assert(!RTListIsEmpty(&pMap->ReleasedList));
+        Assert(!RTListIsEmpty(&pReplacedDemEntry->Node));
+        Assert(RTListIsEmpty(&pNewDemEntry->Node));
+        Assert(!pNewDemEntry->Entry.pvORInstance);
+        if (!pNewDemEntry->Entry.pvORInstance)
+        {
+            pNewDemEntry->Entry.pvORInstance = pReplacedDemEntry->Entry.pvORInstance;
+            pReplacedDemEntry->Entry.pvORInstance = NULL;
+        }
+        RTListNodeRemove(&pReplacedDemEntry->Node);
+        crDemEntryFree(pReplacedDemEntry);
+    }
+
+    if (!pMap->cEntered)
+    {
+        CR_DEM_ENTRY *pCurEntry, *pNextEntry;
+        RTListForEachSafe(&pMap->ReleasedList, pCurEntry, pNextEntry, CR_DEM_ENTRY, Node)
+        {
+            RTListNodeRemove(&pCurEntry->Node);
+            crDemEntryFree(pCurEntry);
+        }
+    }
 }
 
@@ -516,4 +560,5 @@
     pDemEntry->pInfo = pInfo;
     pDemEntry->pMap = pMap;
+    RTListInit(&pDemEntry->Node);
 
     /* just use main context info's context to hold the texture reference */
@@ -711,5 +756,5 @@
 }
 
-void CrHlpPutTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLenum enmFormat, void *pvData)
+void CrHlpPutTexImage(CRContext *pCurCtx, const VBOXVR_TEXTURE *pTexture, GLenum enmFormat, void *pvData)
 {
     CRASSERT(pTexture->hwid);
@@ -743,5 +788,5 @@
 }
 
-void* CrHlpGetTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLuint idPBO, GLenum enmFormat)
+void* CrHlpGetTexImage(CRContext *pCurCtx, const VBOXVR_TEXTURE *pTexture, GLuint idPBO, GLenum enmFormat)
 {
     void *pvData = NULL;
@@ -843,5 +888,5 @@
     {
         RTPOINT Point = {xPos, yPos};
-        int rc = CrDpEntryRegionsAdd(pDisplay, pEntry, &Point, (uint32_t)cRects, (const RTRECT*)pRects);
+        int rc = CrDpEntryRegionsAdd(pDisplay, pEntry, &Point, (uint32_t)cRects, (const RTRECT*)pRects, &cr_server.PresentTexturepMap);
         if (!RT_SUCCESS(rc))
         {
Index: /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c	(revision 47622)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c	(revision 47623)
@@ -111,4 +111,10 @@
 {
     return crServerDispatchWindowCreateEx(dpyName, visBits, -1);
+}
+
+static DECLCALLBACK(void) crServerMuralDefaultEntryReleasedCB(const struct VBOXVR_SCR_COMPOSITOR *pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pReplacingEntry)
+{
+    CR_DISPLAY_ENTRY *pDEntry = CR_DENTRY_FROM_CENTRY(pEntry);
+    crServerDEntryCleanup(pDEntry);
 }
 
@@ -153,5 +159,5 @@
         Tex.target = GL_TEXTURE_2D;
         Tex.hwid = 0;
-        CrVrScrCompositorEntryInit(&mural->DefaultDEntry.CEntry, &Tex, NULL);
+        CrVrScrCompositorEntryInit(&mural->DefaultDEntry.CEntry, &Tex, crServerMuralDefaultEntryReleasedCB);
 
         if (cr_server.fRootVrOn)
@@ -160,4 +166,6 @@
             mural->fRootVrOn = GL_TRUE;
         }
+
+        mural->DefaultDEntry.pvORInstance = NULL;
     }
 
@@ -179,6 +187,4 @@
     mural->bReceivedRects = GL_FALSE;
 
-    mural->pvOutputRedirectInstance = NULL;
-
     /* generate ID for this new window/mural (special-case for file conns) */
     if (cr_server.curClient && cr_server.curClient->conn->type == CR_FILE)
@@ -207,6 +213,4 @@
         }
     }
-
-    crServerSetupOutputRedirect(mural);
 
     if (mural->fRootVrOn)
@@ -364,10 +368,4 @@
 void crServerMuralTerm(CRMuralInfo *mural)
 {
-    if (mural->pvOutputRedirectInstance)
-    {
-        cr_server.outputRedirect.CROREnd(mural->pvOutputRedirectInstance);
-        mural->pvOutputRedirectInstance = NULL;
-    }
-
     crServerRedirMuralFBO(mural, CR_SERVER_REDIR_F_NONE);
     crServerDeleteMuralFBO(mural);
@@ -627,24 +625,5 @@
     crServerWindowVisibleRegion(mural);
 
-    if (mural->pvOutputRedirectInstance)
-    {
-        uint32_t cRects;
-        const RTRECT *pRects;
-
-        /* always get non-stretched rects for output redirect */
-//        if (mural->fRootVrOn)
-        {
-            rc = CrVrScrCompositorRegionsGet(&mural->Compositor, &cRects, NULL, NULL, &pRects);
-            if (!RT_SUCCESS(rc))
-            {
-                crWarning("CrVrScrCompositorRegionsGet failed, rc %d", rc);
-                goto end;
-            }
-        }
-        /* @todo the code assumes that RTRECT == four GLInts. */
-        cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance,
-                cRects, pRects);
-    }
-
+    crServerDEntryAllResized(mural);
 end:
     /* 3. (so far not needed for resize, but in case it is in the future) re-set the compositor (see above comment) */
@@ -731,4 +710,6 @@
             crServerCheckMuralGeometry(mural);
 
+        crServerDEntryAllMoved(mural);
+
         /* 3. re-set the compositor (see above comment) */
         crServerVBoxCompositionDisableLeave(mural, fForcePresent);
@@ -817,20 +798,5 @@
         crServerWindowVisibleRegion(mural);
 
-        if (mural->pvOutputRedirectInstance)
-        {
-            const RTRECT * pRealRects;
-            uint32_t cRealRects;
-
-            /* always get unstretched regions here */
-            rc = CrVrScrCompositorRegionsGet(&mural->Compositor, &cRealRects, NULL, NULL, &pRealRects);
-            if (!RT_SUCCESS(rc))
-            {
-                crWarning("CrVrScrCompositorRegionsGet failed, rc %d", rc);
-                goto end;
-            }
-
-            /* @todo the code assumes that RTRECT == four GLInts. */
-            cr_server.outputRedirect.CRORVisibleRegion(mural->pvOutputRedirectInstance, cRealRects, pRealRects);
-        }
+        crServerDEntryAllVibleRegions(mural);
     }
 end:
