Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 61964)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 61965)
@@ -363,19 +363,4 @@
 # endif /* QT_VERSION < 0x050000 */
 
-    /* If there is a mini-toolbar: */
-    if (m_pMiniToolBar)
-    {
-# if QT_VERSION >= 0x050000
-        /* Map mini-toolbar onto required screen: */
-        m_pMiniToolBar->windowHandle()->setScreen(qApp->screens().at(iHostScreen));
-# endif /* QT_VERSION >= 0x050000 */
-        /* Set appropriate mini-toolbar size: */
-        m_pMiniToolBar->resize(workingArea.size());
-# if QT_VERSION < 0x050000
-        /* Move mini-toolbar onto required screen: */
-        m_pMiniToolBar->move(workingArea.topLeft());
-# endif /* QT_VERSION < 0x050000 */
-    }
-
 #elif defined(VBOX_WS_X11)
 
@@ -387,24 +372,9 @@
         /* Tell recent window managers which host-screen this window should be mapped to: */
         VBoxGlobal::setFullScreenMonitorX11(this, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId));
-
-        /* If there is a mini-toolbar: */
-        if (m_pMiniToolBar)
-        {
-            /* Tell recent window managers which host-screen this mini-toolbar should be mapped to: */
-            VBoxGlobal::setFullScreenMonitorX11(m_pMiniToolBar, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId));
-        }
-    }
-
-    /* Set appropriate geometry for window: */
+    }
+
+    /* Set appropriate window geometry: */
     resize(workingArea.size());
     move(workingArea.topLeft());
-
-    /* If there is a mini-toolbar: */
-    if (m_pMiniToolBar)
-    {
-        /* Set appropriate geometry for mini-toolbar: */
-        m_pMiniToolBar->resize(workingArea.size());
-        m_pMiniToolBar->move(workingArea.topLeft());
-    }
 
 #else
@@ -462,12 +432,4 @@
         setWindowState(Qt::WindowNoState);
         hide();
-
-        /* If there is mini-toolbar: */
-        if (m_pMiniToolBar)
-        {
-            /* Hide mini-toolbar and reset it's state to NONE: */
-            m_pMiniToolBar->setWindowState(Qt::WindowNoState);
-            m_pMiniToolBar->hide();
-        }
     }
     /* If window should be shown and mapped to some host-screen: */
@@ -480,11 +442,4 @@
         /* Make sure window have appropriate geometry: */
         placeOnScreen();
-
-        /* If there is mini-toolbar: */
-        if (m_pMiniToolBar)
-        {
-            /* Show mini-toolbar: */
-            m_pMiniToolBar->showFullScreen();
-        }
 
         /* Show window: */
@@ -518,12 +473,4 @@
         setWindowState(Qt::WindowNoState);
         hide();
-
-        /* If there is mini-toolbar: */
-        if (m_pMiniToolBar)
-        {
-            /* Hide mini-toolbar and reset it's state to NONE: */
-            m_pMiniToolBar->setWindowState(Qt::WindowNoState);
-            m_pMiniToolBar->hide();
-        }
     }
     /* If window should be shown and mapped to some host-screen: */
@@ -536,11 +483,4 @@
         /* Show window: */
         showFullScreen();
-
-        /* If there is mini-toolbar: */
-        if (m_pMiniToolBar)
-        {
-            /* Show mini-toolbar: */
-            m_pMiniToolBar->showFullScreen();
-        }
 
         /* Make sure window have appropriate geometry: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp	(revision 61964)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp	(revision 61965)
@@ -30,4 +30,8 @@
 # include <QStateMachine>
 # include <QPainter>
+# include <QDesktopWidget>
+# ifdef VBOX_WS_WIN
+#  include <QWindow>
+# endif /* VBOX_WS_WIN */
 
 /* GUI includes: */
@@ -36,4 +40,7 @@
 # include "UIIconPool.h"
 # include "VBoxGlobal.h"
+# ifdef VBOX_WS_X11
+#  include "UIExtraDataManager.h"
+# endif /* VBOX_WS_X11 */
 
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
@@ -555,9 +562,116 @@
 }
 
+void UIMiniToolBar::sltHide()
+{
+    LogRel2(("GUI: UIMiniToolBar::sltHide\n"));
+
+#if defined(VBOX_WS_MAC)
+
+    // Nothing
+
+#elif defined(VBOX_WS_WIN)
+
+    /* Reset window state to NONE and hide it: */
+    setWindowState(Qt::WindowNoState);
+    hide();
+
+#elif defined(VBOX_WS_X11)
+
+    /* Just hide window: */
+    hide();
+
+#else
+
+# warning "port me"
+
+#endif
+}
+
+void UIMiniToolBar::sltShow()
+{
+    LogRel2(("GUI: UIMiniToolBar::sltShow\n"));
+
+#if defined(VBOX_WS_MAC)
+
+    // Nothing
+
+#elif defined(VBOX_WS_WIN)
+
+    /* Adjust window before showing full-screen: */
+    sltAdjust();
+    showFullScreen();
+
+#elif defined(VBOX_WS_X11)
+
+    /* Show window full-screen before adjusting: */
+    showFullScreen();
+    sltAdjust();
+
+#else
+
+# warning "port me"
+
+#endif
+}
+
+void UIMiniToolBar::sltAdjust()
+{
+    LogRel2(("GUI: UIMiniToolBar::sltAdjust\n"));
+
+    /* Get corresponding host-screen: */
+    const int iHostScreen = QApplication::desktop()->screenNumber(parentWidget());
+    Q_UNUSED(iHostScreen);
+    /* And corresponding working area: */
+    const QRect workingArea = vboxGlobal().screenGeometry(iHostScreen);
+    Q_UNUSED(workingArea);
+
+#if defined(VBOX_WS_MAC)
+
+    // Nothing
+
+#elif defined(VBOX_WS_WIN)
+
+# if QT_VERSION >= 0x050000
+    /* Map window onto required screen: */
+    Assert(iHostScreen < qApp->screens().size());
+    windowHandle()->setScreen(qApp->screens().at(iHostScreen));
+# endif /* QT_VERSION >= 0x050000 */
+    /* Set appropriate window size: */
+    resize(workingArea.size());
+# if QT_VERSION < 0x050000
+    /* Move window onto required screen: */
+    move(workingArea.topLeft());
+# endif /* QT_VERSION < 0x050000 */
+
+#elif defined(VBOX_WS_X11)
+
+    /* Determine whether we should use the native full-screen mode: */
+    const bool fUseNativeFullScreen = VBoxGlobal::supportsFullScreenMonitorsProtocolX11() &&
+                                      !gEDataManager->legacyFullscreenModeRequested();
+    if (fUseNativeFullScreen)
+    {
+        /* Tell recent window managers which host-screen this window should be mapped to: */
+        VBoxGlobal::setFullScreenMonitorX11(this, iHostScreen);
+    }
+
+    /* Set appropriate window geometry: */
+    resize(workingArea.size());
+    move(workingArea.topLeft());
+
+    /* Re-apply the full-screen state lost on above move(): */
+    setWindowState(Qt::WindowFullScreen);
+
+#else
+
+# warning "port me"
+
+#endif
+}
+
 void UIMiniToolBar::prepare()
 {
-    /* Install own event-filter
-     * to handle window activation stealing: */
+    /* Install event-filters: */
     installEventFilter(this);
+    parent()->installEventFilter(this);
 
 #if   defined(VBOX_WS_WIN)
@@ -719,4 +833,51 @@
     }
 
+    /* If that's parent window event: */
+    if (pWatched == parent())
+    {
+        switch (pEvent->type())
+        {
+            case QEvent::Hide:
+            {
+                /* Asynchronously call for sltHide(): */
+                LogRel2(("GUI: UIMiniToolBar::eventFilter: Parent hide event\n"));
+                QMetaObject::invokeMethod(this, "sltHide", Qt::QueuedConnection);
+                break;
+            }
+            case QEvent::Show:
+            {
+                /* Asynchronously call for sltShow(): */
+                LogRel2(("GUI: UIMiniToolBar::eventFilter: Parent show event\n"));
+                QMetaObject::invokeMethod(this, "sltShow", Qt::QueuedConnection);
+                break;
+            }
+            case QEvent::Move:
+            case QEvent::Resize:
+            {
+                /* Skip if parent or we are invisible: */
+                if (   !parentWidget()->isVisible()
+                    || !isVisible())
+                    break;
+
+#if   defined(VBOX_WS_MAC)
+                // Nothing
+#elif defined(VBOX_WS_WIN)
+                /* Asynchronously call for sltShow() to adjust and expose both: */
+                LogRel2(("GUI: UIMiniToolBar::eventFilter: Parent move/resize event\n"));
+                QMetaObject::invokeMethod(this, "sltShow", Qt::QueuedConnection);
+#elif defined(VBOX_WS_X11)
+                /* Asynchronously call for just sltAdjust() because it's enough: */
+                LogRel2(("GUI: UIMiniToolBar::eventFilter: Parent move/resize event\n"));
+                QMetaObject::invokeMethod(this, "sltAdjust", Qt::QueuedConnection);
+#else
+# warning "port me"
+#endif
+                break;
+            }
+            default:
+                break;
+        }
+    }
+
     /* Call to base-class: */
     return QWidget::eventFilter(pWatched, pEvent);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h	(revision 61964)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h	(revision 61965)
@@ -115,4 +115,11 @@
     void sltNotifyAboutWindowActivationStolen() { emit sigNotifyAboutWindowActivationStolen(); }
 
+    /** Hides window. */
+    void sltHide();
+    /** Shows and adjusts window according to parent. */
+    void sltShow();
+    /** Adjusts window according to parent. */
+    void sltAdjust();
+
 private:
 
