Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 52890)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 52891)
@@ -3354,4 +3354,12 @@
                                1 /* Source indication (1 = normal application) */);
 }
+
+/* static */
+void VBoxGlobal::setTransientFor(QWidget *pWidget, QWidget *pPropWidget)
+{
+    XSetTransientForHint(pWidget->x11Info().display(),
+                         pWidget->window()->winId(),
+                         pPropWidget->window()->winId());
+}
 #endif /* Q_WS_X11 */
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 52890)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 52891)
@@ -323,4 +323,6 @@
     /** X11: Performs mapping of the passed @a pWidget to host-screen with passed @a uScreenId. */
     static bool setFullScreenMonitorX11(QWidget *pWidget, ulong uScreenId);
+    /** X11: Ensures @a pPropWidget become transient for the @a pWidget. */
+    static void setTransientFor(QWidget *pWidget, QWidget *pPropWidget);
 #endif /* Q_WS_X11 */
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 52890)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 52891)
@@ -188,8 +188,8 @@
     /* Revoke stolen focus: */
     m_pMachineView->setFocus();
-#elif defined(Q_WS_MAC)
+#elif defined(Q_WS_MAC) || defined(Q_WS_X11)
     /* Revoke stolen activation: */
     activateWindow();
-#endif /* Q_WS_MAC */
+#endif /* Q_WS_MAC || Q_WS_X11 */
 }
 
@@ -364,11 +364,19 @@
         !pFullscreenLogic->hasHostScreenForGuestScreen(m_uScreenId))
     {
-        /* Hide mini-toolbar: */
-        if (   m_pMiniToolBar
-#ifdef Q_WS_MAC
-            && !fSupportsNativeFullScreen
-#endif /* Q_WS_MAC */
-            )
+        /* If there is mini-toolbar: */
+        if (m_pMiniToolBar)
+        {
+#if   defined(Q_WS_WIN) || defined(Q_WS_X11)
+            /* Just hide mini-toolbar: */
             m_pMiniToolBar->hide();
+#elif defined(Q_WS_MAC)
+            /* If no native full-screen used: */
+            if (!fSupportsNativeFullScreen)
+            {
+                /* Just hide mini-toolbar: */
+                m_pMiniToolBar->hide();
+            }
+#endif /* Q_WS_MAC */
+        }
         /* Hide window: */
         hide();
@@ -425,11 +433,30 @@
     adjustMachineViewSize();
 
-    /* Show mini-toolbar: */
-    if (   m_pMiniToolBar
-#ifdef Q_WS_MAC
-        && !fSupportsNativeFullScreen
-#endif /* Q_WS_MAC */
-        )
+    /* If there is mini-toolbar: */
+    if (m_pMiniToolBar)
+    {
+#if   defined(Q_WS_WIN)
+        /* Just show mini-toolbar: */
         m_pMiniToolBar->show();
+#elif defined(Q_WS_MAC)
+        /* If no native full-screen used: */
+        if (!fSupportsNativeFullScreen)
+        {
+            /* Just show mini-toolbar: */
+            m_pMiniToolBar->show();
+        }
+#elif defined(Q_WS_X11)
+        /* Allow mini-toolbar to be located on full-screen area: */
+        m_pMiniToolBar->showFullScreen();
+        /* On modern window managers: */
+        if (fSupportsNativeFullScreen)
+        {
+            /* We also can map mini-toolbar directly on corresponding machine-window: */
+            VBoxGlobal::setFullScreenMonitorX11(m_pMiniToolBar, pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId));
+        }
+        /* Make sure mini-toolbar is always on top of machine-window: */
+        VBoxGlobal::setTransientFor(m_pMiniToolBar, this);
+#endif /* Q_WS_X11 */
+    }
 
     /* Make sure machine-view have focus: */
@@ -452,6 +479,14 @@
         const int iHostScreen = pFullscreenLogic->hostScreenForGuestScreen(m_uScreenId);
 
+#ifndef Q_WS_X11
         /* Move mini-toolbar into appropriate place: */
         m_pMiniToolBar->adjustGeometry(iHostScreen);
+#else /* Q_WS_X11 */
+        /* On modern WMs we are mapping mini-toolbar to corresponding host-screen directly. */
+        const bool fSupportsNativeFullScreen = VBoxGlobal::supportsFullScreenMonitorsProtocolX11() &&
+                                               !gEDataManager->legacyFullscreenModeRequested();
+        /* Adjust mini-toolbar and move into appropriate place if necessary: */
+        m_pMiniToolBar->adjustGeometry(fSupportsNativeFullScreen ? -1 : iHostScreen);
+#endif /* Q_WS_X11 */
     }
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp	(revision 52890)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp	(revision 52891)
@@ -74,25 +74,9 @@
     /* Revoke stolen focus: */
     m_pMachineView->setFocus();
-#elif defined(Q_WS_MAC)
+#elif defined(Q_WS_MAC) || defined(Q_WS_X11)
     /* Revoke stolen activation: */
     activateWindow();
-#endif /* Q_WS_MAC */
-}
-
-#ifdef VBOX_WITH_MASKED_SEAMLESS
-# ifdef Q_WS_X11
-void UIMachineWindowSeamless::sltUpdateMiniToolbarMask(const QRect &geo)
-{
-    /* Make sure mini-toolbar exists: */
-    AssertPtrReturnVoid(m_pMiniToolBar);
-
-    /* Remember mini-toolbar mask: */
-    m_maskMiniToolbar = geo;
-
-    /* Re-assign guest mask. */
-    setMask(m_maskGuest);
-}
-# endif /* Q_WS_X11 */
-#endif /* VBOX_WITH_MASKED_SEAMLESS */
+#endif /* Q_WS_MAC || Q_WS_X11 */
+}
 
 void UIMachineWindowSeamless::prepareVisualState()
@@ -153,10 +137,4 @@
             actionPool()->action(UIActionIndexRT_M_Machine_S_Close), SLOT(trigger()));
     connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()), this, SLOT(sltRevokeFocus()));
-#ifdef VBOX_WITH_MASKED_SEAMLESS
-# ifdef Q_WS_X11
-    connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutGeometryChange(const QRect&)),
-            this, SLOT(sltUpdateMiniToolbarMask(const QRect&)));
-# endif /* Q_WS_X11 */
-#endif /* VBOX_WITH_MASKED_SEAMLESS */
 }
 #endif /* !Q_WS_MAC */
@@ -213,7 +191,10 @@
     {
 #ifndef Q_WS_MAC
-        /* Hide mini-toolbar: */
+        /* If there is mini-toolbar: */
         if (m_pMiniToolBar)
+        {
+            /* Just hide mini-toolbar: */
             m_pMiniToolBar->hide();
+        }
 #endif /* !Q_WS_MAC */
         /* Hide window: */
@@ -236,7 +217,17 @@
 
 #ifndef Q_WS_MAC
-    /* Show mini-toolbar: */
+    /* If there is mini-toolbar: */
     if (m_pMiniToolBar)
+    {
+# if   defined(Q_WS_WIN)
+        /* Just show mini-toolbar: */
         m_pMiniToolBar->show();
+# elif defined(Q_WS_X11)
+        /* Allow mini-toolbar to be located on full-screen area: */
+        m_pMiniToolBar->showMaximized();
+        /* Make sure mini-toolbar is always on top of machine-window: */
+        VBoxGlobal::setTransientFor(m_pMiniToolBar, this);
+# endif /* Q_WS_X11 */
+    }
 #endif /* !Q_WS_MAC */
 
@@ -319,10 +310,4 @@
         maskFull.translate(m_pLeftSpacer->geometry().width(), m_pTopSpacer->geometry().height());
 
-# ifdef Q_WS_X11
-    /* Take into account mini-toolbar mask if necessary: */
-    if (m_pMiniToolBar)
-        maskFull += m_maskMiniToolbar;
-# endif /* Q_WS_X11 */
-
     /* Seamless-window for empty full mask should be empty too,
      * but the QWidget::setMask() wrapper doesn't allow this.
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h	(revision 52890)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h	(revision 52891)
@@ -43,11 +43,4 @@
     /** Revokes keyboard-focus. */
     void sltRevokeFocus();
-
-#ifdef VBOX_WITH_MASKED_SEAMLESS
-# ifdef Q_WS_X11
-    /** Assigns mini-toolbar seamless mask. */
-    void sltUpdateMiniToolbarMask(const QRect &geo);
-# endif /* Q_WS_X11 */
-#endif /* VBOX_WITH_MASKED_SEAMLESS */
 
 private:
@@ -97,8 +90,4 @@
     /** Holds the guest seamless mask. */
     QRegion m_maskGuest;
-# ifdef Q_WS_X11
-    /** Holds the mini-toolbar seamless mask. */
-    QRect m_maskMiniToolbar;
-# endif /* Q_WS_X11 */
 #endif /* VBOX_WITH_MASKED_SEAMLESS */
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp	(revision 52890)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp	(revision 52891)
@@ -52,11 +52,9 @@
                                            bool fAutoHide /* = true */)
     : QWidget(pParent,
-#if   defined (Q_WS_WIN)
+#if   defined(Q_WS_WIN)
               Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint
-#elif defined (Q_WS_MAC)
+#elif defined(Q_WS_MAC) || defined(Q_WS_X11)
               Qt::Window | Qt::FramelessWindowHint
-#elif defined (Q_WS_X11)
-              Qt::Widget
-#endif /* RT_OS_DARWIN */
+#endif /* Q_WS_MAC || Q_WS_X11 */
               )
     /* Variables: General stuff: */
@@ -143,4 +141,5 @@
 void UIRuntimeMiniToolBar::adjustGeometry(int iHostScreen /* = -1 */)
 {
+#ifndef Q_WS_X11
     /* This method could be called before parent-widget
      * become visible, we should skip everything in that case: */
@@ -166,9 +165,4 @@
         default: break;
     }
-#ifdef Q_WS_X11
-    /* Disregard origin under X11,
-     * because this is widget, not window: */
-    screenRect.moveTopLeft(QPoint(0, 0));
-#endif /* Q_WS_X11 */
     iX = screenRect.x() + screenRect.width() / 2 - width() / 2;
     switch (m_alignment)
@@ -202,4 +196,68 @@
     /* Simulate toolbar auto-hiding: */
     simulateToolbarAutoHiding();
+
+#else /* Q_WS_X11 */
+
+    /* This method could be called before parent-widget
+     * become visible, we should skip everything in that case: */
+    if (QApplication::desktop()->screenNumber(parentWidget()) == -1)
+        return;
+
+    /* Determine host-screen number if necessary: */
+    bool fMoveToHostScreen = true;
+    if (iHostScreen == -1)
+    {
+        fMoveToHostScreen = false;
+        iHostScreen = QApplication::desktop()->screenNumber(this);
+    }
+
+    /* Choose window geometry: */
+    QRect screenRect;
+    switch (m_geometryType)
+    {
+        case GeometryType_Available: screenRect = QApplication::desktop()->availableGeometry(iHostScreen); break;
+        case GeometryType_Full:      screenRect = QApplication::desktop()->screenGeometry(iHostScreen); break;
+        default: break;
+    }
+
+    /* Move to corresponding host-screen: */
+    if (fMoveToHostScreen)
+        move(screenRect.topLeft());
+
+    /* Resize embedded-toolbar to minimum size: */
+    m_pEmbeddedToolbar->resize(m_pEmbeddedToolbar->sizeHint());
+
+    /* Calculate embedded-toolbar position: */
+    int iX = 0, iY = 0;
+    iX = screenRect.width() / 2 - m_pEmbeddedToolbar->width() / 2;
+    switch (m_alignment)
+    {
+        case Qt::AlignTop:    iY = 0; break;
+        case Qt::AlignBottom: iY = screenRect.height() - m_pEmbeddedToolbar->height(); break;
+        default: break;
+    }
+
+    /* Update auto-hide animation: */
+    m_shownToolbarPosition = QPoint(iX, iY);
+    switch (m_alignment)
+    {
+        case Qt::AlignTop:    m_hiddenToolbarPosition = m_shownToolbarPosition - QPoint(0, m_pEmbeddedToolbar->height() - 3); break;
+        case Qt::AlignBottom: m_hiddenToolbarPosition = m_shownToolbarPosition + QPoint(0, m_pEmbeddedToolbar->height() - 3); break;
+    }
+    m_pAnimation->update();
+
+    /* Update embedded-toolbar geometry if known: */
+    const QString strAnimationState = property("AnimationState").toString();
+    if (strAnimationState == "Start")
+        m_pEmbeddedToolbar->move(m_hiddenToolbarPosition);
+    else if (strAnimationState == "Final")
+        m_pEmbeddedToolbar->move(m_shownToolbarPosition);
+
+    /* Adjust window mask: */
+    setMask(m_pEmbeddedToolbar->geometry());
+
+    /* Simulate toolbar auto-hiding: */
+    simulateToolbarAutoHiding();
+#endif /* Q_WS_X11 */
 }
 
@@ -238,8 +296,8 @@
 void UIRuntimeMiniToolBar::prepare()
 {
-#ifdef Q_WS_MAC
+#if defined(Q_WS_MAC) || defined (Q_WS_X11)
     /* Install own event filter: */
     installEventFilter(this);
-#endif /* Q_WS_MAC */
+#endif /* Q_WS_MAC || Q_WS_X11 */
 
 #if defined(Q_WS_MAC) || defined(Q_WS_WIN)
@@ -259,5 +317,9 @@
     setAttribute(Qt::WA_TranslucentBackground);
 # endif /* Q_WS_WIN */
-#endif /* Q_WS_MAC || Q_WS_WIN */
+#elif defined(Q_WS_X11)
+    /* Use Qt API to enable translucency if allowed: */
+    if (QX11Info::isCompositingManagerRunning())
+        setAttribute(Qt::WA_TranslucentBackground);
+#endif /* Q_WS_X11 */
 
     /* Make sure we have no focus: */
@@ -378,4 +440,12 @@
 }
 
+#ifdef Q_WS_X11
+void UIRuntimeMiniToolBar::resizeEvent(QResizeEvent*)
+{
+    /* Adjust mini-toolbar on resize: */
+    adjustGeometry();
+}
+#endif /* Q_WS_X11 */
+
 bool UIRuntimeMiniToolBar::eventFilter(QObject *pWatched, QEvent *pEvent)
 {
@@ -388,11 +458,10 @@
         pEvent->type() == QEvent::FocusIn)
         emit sigNotifyAboutFocusStolen();
-#elif defined(Q_WS_MAC)
-    /* Due to Qt bug on Mac OS X window will be activated
-     * even if has Qt::WA_ShowWithoutActivating attribute. */
+#elif defined(Q_WS_MAC) || defined(Q_WS_X11)
+    /* Detect if we have window activation stolen. */
     if (pWatched == this &&
         pEvent->type() == QEvent::WindowActivate)
         emit sigNotifyAboutFocusStolen();
-#endif /* Q_WS_MAC */
+#endif /* Q_WS_MAC || Q_WS_X11 */
 
     /* Call to base-class: */
@@ -423,10 +492,4 @@
     /* Update window mask: */
     setMask(m_pEmbeddedToolbar->geometry());
-
-# ifdef VBOX_WITH_MASKED_SEAMLESS
-    /* Notify listeners as well: */
-    const QRect windowGeo = geometry();
-    emit sigNotifyAboutGeometryChange(windowGeo.intersected(m_pEmbeddedToolbar->geometry().translated(windowGeo.topLeft())));
-# endif /* VBOX_WITH_MASKED_SEAMLESS */
 #endif /* Q_WS_X11 */
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h	(revision 52890)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h	(revision 52891)
@@ -64,11 +64,4 @@
     void sigNotifyAboutFocusStolen();
 
-#ifdef VBOX_WITH_MASKED_SEAMLESS
-# ifdef Q_WS_X11
-    /** Notifies about geometry change. */
-    void sigNotifyAboutGeometryChange(const QRect &geo);
-# endif /* Q_WS_X11 */
-#endif /* VBOX_WITH_MASKED_SEAMLESS */
-
 public:
 
@@ -118,4 +111,9 @@
     void enterEvent(QEvent *pEvent);
     void leaveEvent(QEvent *pEvent);
+
+#ifdef Q_WS_X11
+    /** X11: Resize event handler. */
+    void resizeEvent(QResizeEvent *pEvent);
+#endif /* Q_WS_X11 */
 
     /** Filters @a pEvent if <i>this</i> object has been
