Index: trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp	(revision 47492)
+++ trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp	(revision 47493)
@@ -303,12 +303,9 @@
 }
 
-void UIPopupCenter::raisePopupStack(QWidget *pParent)
+void UIPopupCenter::reinstallPopupStack(QWidget *pParent, bool fAsTopLevel)
 {
     /* Make sure passed parent is valid: */
     if (!pParent)
-    {
-        AssertMsgFailed(("Passed parent is NULL"));
-        return;
-    }
+        return;
 
     /* Do we have a stack for passed parent? */
@@ -317,9 +314,17 @@
         return;
 
+    /* Make sure we should really reinstall stack: */
+    if ((fAsTopLevel && m_type == UIPopupIntegrationType_Toplevel) ||
+        (!fAsTopLevel && m_type == UIPopupIntegrationType_Embedded))
+        return;
+
+    LogRelFlow(("UIPopupCenter::reinstallPopupStack: Reinstalling popup-stack as %s.\n",
+                fAsTopLevel ? "top level window" : "embedded widget"));
+
     /* Remove stack: */
     hidePopupStack(pParent);
 
     /* Make sure integration type is correct: */
-    setStackIntegrationType(UIPopupIntegrationType_Toplevel);
+    setStackIntegrationType(fAsTopLevel ? UIPopupIntegrationType_Toplevel : UIPopupIntegrationType_Embedded);
 
     /* Return stack again: */
@@ -389,7 +394,7 @@
 }
 
-void UIPopupCenter::sltRaisePopupStack()
-{
-    raisePopupStack(vboxGlobal().activeMachineWindow());
+void UIPopupCenter::sltReinstallPopupStack(bool fAsTopLevel)
+{
+    reinstallPopupStack(vboxGlobal().activeMachineWindow(), fAsTopLevel);
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h	(revision 47492)
+++ trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h	(revision 47493)
@@ -116,5 +116,5 @@
     void sltShowPopupStack();
     void sltHidePopupStack();
-    void sltRaisePopupStack();
+    void sltReinstallPopupStack(bool fAsTopLevel);
     void sltRemovePopupStack();
 
@@ -140,5 +140,5 @@
     void showPopupStack(QWidget *pParent);
     void hidePopupStack(QWidget *pParent);
-    void raisePopupStack(QWidget *pParent);
+    void reinstallPopupStack(QWidget *pParent, bool fAsTopLevel);
     void assignPopupStackParent(UIPopupStack *pPopupStack, QWidget *pParent);
     void unassignPopupStackParent(UIPopupStack *pPopupStack, QWidget *pParent);
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp	(revision 47492)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp	(revision 47493)
@@ -348,10 +348,10 @@
         case VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA:
         {
+            /* Notify GUI about 3D overlay visibility change: */
             BOOL fVisible = !!pData;
-
-            /* @todo: implement 3D visibility handling */
-//            /* Notify GUI about 3D event: */
-//            emit sigNotify3DEvent();
-
+            LogRelFlow(("UIFrameBuffer::Notify3DEvent: "
+                        "VBOX3D_NOTIFY_EVENT_TYPE_VISIBLE_3DDATA=%s\n",
+                        fVisible ? "TRUE" : "FALSE"));
+            emit sigNotifyAbout3DOverlayVisibilityChange(fVisible);
             return S_OK;
         }
@@ -427,6 +427,6 @@
             m_pMachineView, SLOT(sltHandleSetVisibleRegion(QRegion)),
             Qt::QueuedConnection);
-    connect(this, SIGNAL(sigNotify3DEvent()),
-            m_pMachineView, SLOT(sltNotify3DEvent()),
+    connect(this, SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)),
+            m_pMachineView, SLOT(sltHandle3DOverlayVisibilityChange(bool)),
             Qt::QueuedConnection);
 }
@@ -440,6 +440,6 @@
     disconnect(this, SIGNAL(sigSetVisibleRegion(QRegion)),
                m_pMachineView, SLOT(sltHandleSetVisibleRegion(QRegion)));
-    disconnect(this, SIGNAL(sigNotify3DEvent()),
-               m_pMachineView, SLOT(sltNotify3DEvent()));
-}
-
+    disconnect(this, SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)),
+               m_pMachineView, SLOT(sltHandle3DOverlayVisibilityChange(bool)));
+}
+
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h	(revision 47492)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h	(revision 47493)
@@ -99,5 +99,5 @@
     void sigNotifyUpdate(int iX, int iY, int iWidth, int iHeight);
     void sigSetVisibleRegion(QRegion region);
-    void sigNotify3DEvent();
+    void sigNotifyAbout3DOverlayVisibilityChange(bool fVisible);
 
 public:
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 47492)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 47493)
@@ -351,8 +351,8 @@
 }
 
-void UIMachineLogic::notifyAbout3DEvent()
-{
-    /* Notify listener about 3D event: */
-    emit sigNotify3DEvent();
+void UIMachineLogic::notifyAbout3DOverlayVisibilityChange(bool fVisible)
+{
+    /* Notify listener about 3D overlay visibility change: */
+    emit sigNotifyAbout3DOverlayVisibilityChange(fVisible);
 }
 
@@ -549,6 +549,6 @@
     connect(this, SIGNAL(sigMachineWindowsDestroyed()),
             &popupCenter(), SLOT(sltHidePopupStack()));
-    connect(this, SIGNAL(sigNotify3DEvent()),
-            &popupCenter(), SLOT(sltRaisePopupStack()));
+    connect(this, SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)),
+            &popupCenter(), SLOT(sltReinstallPopupStack(bool)));
 }
 
@@ -560,6 +560,6 @@
     disconnect(this, SIGNAL(sigMachineWindowsDestroyed()),
                &popupCenter(), SLOT(sltHidePopupStack()));
-    disconnect(this, SIGNAL(sigNotify3DEvent()),
-               &popupCenter(), SLOT(sltRaisePopupStack()));
+    disconnect(this, SIGNAL(sigNotifyAbout3DOverlayVisibilityChange(bool)),
+               &popupCenter(), SLOT(sltReinstallPopupStack(bool)));
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 47492)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 47493)
@@ -58,5 +58,5 @@
     void sigMachineWindowsCreated();
     void sigMachineWindowsDestroyed();
-    void sigNotify3DEvent();
+    void sigNotifyAbout3DOverlayVisibilityChange(bool fVisible);
 
 public:
@@ -101,6 +101,6 @@
     void powerOff(bool fDiscardingState);
 
-    /* API: 3D event stuff: */
-    void notifyAbout3DEvent();
+    /* API: 3D overlay visibility stuff: */
+    void notifyAbout3DOverlayVisibilityChange(bool fVisible);
 
 protected slots:
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 47492)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 47493)
@@ -293,7 +293,7 @@
 }
 
-void UIMachineView::sltNotify3DEvent()
-{
-    machineLogic()->notifyAbout3DEvent();
+void UIMachineView::sltHandle3DOverlayVisibilityChange(bool fVisible)
+{
+    machineLogic()->notifyAbout3DOverlayVisibilityChange(fVisible);
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 47492)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 47493)
@@ -103,6 +103,6 @@
     virtual void sltHandleSetVisibleRegion(QRegion region);
 
-    /* Handler: Frame-buffer Notify3DEvent stuff: */
-    virtual void sltNotify3DEvent();
+    /* Handler: Frame-buffer 3D overlay visibility stuff: */
+    virtual void sltHandle3DOverlayVisibilityChange(bool fVisible);
 
     /* Watch dog for desktop resizes: */
