Index: /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h	(revision 3727)
+++ /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h	(revision 3728)
@@ -95,6 +95,4 @@
     void fixModifierState (LONG *codes, uint *count);
 
-    bool isInSeamlessMode();
-
 signals:
 
Index: /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h	(revision 3727)
+++ /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h	(revision 3728)
@@ -71,9 +71,11 @@
     void refreshView();
 
-    bool isTrueFullscreen() const { return full_screen; }
+    bool isTrueFullscreen() const { return mIsInFullscreenMode; }
 
     bool isTrueSeamless() const { return mIsInSeamlessMode; }
 
     void setMouseIntegrationLocked (bool);
+
+    void popupSeamlessMenu();
 
 public slots:
@@ -115,4 +117,6 @@
     void updateAppearanceOf (int element);
 
+    void toggleFullscreenMode (bool, bool);
+
 private slots:
 
@@ -175,4 +179,6 @@
 
 private:
+
+    QPopupMenu *mSeamlessPopupMenu;
 
     QActionGroup *runningActions;
@@ -282,6 +288,7 @@
 
     // variables for dealing with true fullscreen
-    bool full_screen : 1;
+    bool mIsInFullscreenMode : 1;
     bool mIsInSeamlessMode : 1;
+    bool mIsSeamlessModeSupported : 1;
     int normal_wflags;
     bool was_max : 1;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp	(revision 3727)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp	(revision 3728)
@@ -965,5 +965,6 @@
             {
                 VBoxSetRegionEvent *sre = (VBoxSetRegionEvent*) e;
-                mainwnd->setMask (sre->region());
+                if (mainwnd->isTrueSeamless())
+                    mainwnd->setMask (sre->region());
                 return true;
             }
@@ -1124,5 +1125,8 @@
                     else if (ke->key() == Key_Home)
                     {
-                        mainwnd->menuBar()->setFocus();
+                        if (mainwnd->isTrueSeamless())
+                            mainwnd->popupSeamlessMenu();
+                        else
+                            mainwnd->menuBar()->setFocus();
                     }
                     else
@@ -1842,9 +1846,4 @@
 }
 
-bool VBoxConsoleView::isInSeamlessMode()
-{
-    return mainwnd->isTrueSeamless();
-}
-
 /**
  *  Called on exit from fullscreen or from maximized mode.
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 3727)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 3728)
@@ -52,4 +52,5 @@
 #include <qpushbutton.h>
 #include <qtoolbutton.h>
+#include <qcursor.h>
 
 #include <qeventloop.h>
@@ -214,4 +215,5 @@
                 WFlags aFlags)
     : QMainWindow (aParent, aName, aFlags)
+    , mSeamlessPopupMenu (0)
 #ifdef VBOX_WITH_DEBUGGER_GUI
     , dbgStatisticsAction (NULL)
@@ -224,6 +226,7 @@
     , machine_state (CEnums::InvalidMachineState)
     , no_auto_close (false)
-    , full_screen (false)
+    , mIsInFullscreenMode (false)
     , mIsInSeamlessMode (false)
+    , mIsSeamlessModeSupported (false)
     , normal_wflags (getWFlags())
     , was_max (false)
@@ -373,4 +376,6 @@
 
     ///// Menubar ///////////////////////////////////////////////////////////
+
+    mSeamlessPopupMenu = new QPopupMenu (this, "mSeamlessPopupMenu");
 
     /* VM popup menu */
@@ -400,4 +405,5 @@
     vmDisMouseIntegrMenu = new VBoxSwitchMenu (vmMenu, vmDisableMouseIntegrAction,
                                                true /* inverted toggle state */);
+    mSeamlessPopupMenu->insertItem (QString::null, vmMenu, vmMenuId);
 
     /* Devices popup menu */
@@ -439,4 +445,5 @@
     devicesMenu->setItemParameter (devicesMountDVDMenuId, 0);
     devicesMenu->setItemParameter (devicesUSBMenuId, 0);
+    mSeamlessPopupMenu->insertItem (QString::null, devicesMenu, devicesMenuId);
 
 #ifdef VBOX_WITH_DEBUGGER_GUI
@@ -448,4 +455,5 @@
         dbgCommandLineAction->addTo (dbgMenu);
         menuBar()->insertItem (QString::null, dbgMenu, dbgMenuId);
+        mSeamlessPopupMenu->insertItem (QString::null, dbgMenu, dbgMenuId);
     }
     else
@@ -462,4 +470,5 @@
     helpResetMessagesAction->addTo (helpMenu);
     menuBar()->insertItem( QString::null, helpMenu, helpMenuId );
+    mSeamlessPopupMenu->insertItem (QString::null, helpMenu, helpMenuId);
 
     ///// Status bar ////////////////////////////////////////////////////////
@@ -777,5 +786,5 @@
             normal_pos = QPoint (x, y);
             normal_size = QSize (w, h);
-            if (!full_screen && !vmSeamlessAction->isOn())
+            if (!mIsInFullscreenMode && !vmSeamlessAction->isOn())
             {
                 move (normal_pos);
@@ -794,5 +803,5 @@
             normal_pos = QPoint();
             normal_size = QSize();
-            if (!full_screen && !vmSeamlessAction->isOn())
+            if (!mIsInFullscreenMode && !vmSeamlessAction->isOn())
             {
                 console->normalizeGeometry (true /* adjustPosition */);
@@ -1030,5 +1039,5 @@
                                  .arg (normal_size.width())
                                  .arg (normal_size.height());
-        if (isMaximized() || (full_screen && was_max)
+        if (isMaximized() || (mIsInFullscreenMode && was_max)
                           || (mIsInSeamlessMode && was_max))
             winPos += QString (",%1").arg (GUI_LastWindowPosition_Max);
@@ -1073,4 +1082,9 @@
 }
 
+void VBoxConsoleWnd::popupSeamlessMenu()
+{
+    mSeamlessPopupMenu->popup (QCursor::pos());
+}
+
 //
 // Protected Members
@@ -1088,5 +1102,5 @@
         {
             QResizeEvent *re = (QResizeEvent *) e;
-            if (!full_screen && !mIsInSeamlessMode &&
+            if (!mIsInFullscreenMode && !mIsInSeamlessMode &&
                 (windowState() & (WindowMaximized | WindowMinimized |
                                   WindowFullScreen)) == 0)
@@ -1101,5 +1115,5 @@
         case QEvent::Move:
         {
-            if (!full_screen && !mIsInSeamlessMode &&
+            if (!mIsInFullscreenMode && !mIsInSeamlessMode &&
                 (windowState() & (WindowMaximized | WindowMinimized |
                                   WindowFullScreen)) == 0)
@@ -1478,11 +1492,23 @@
     devicesMenu->changeItem (devicesUSBMenuId, tr ("&USB Devices"));
 
+    /* main menu & seamless popup menu */
+
     menuBar()->changeItem (vmMenuId, tr ("&Machine"));
+    mSeamlessPopupMenu->changeItem (vmMenuId,
+        VBoxGlobal::iconSet ("ico16x01.png"), tr ("&Machine"));
     menuBar()->changeItem (devicesMenuId, tr ("&Devices"));
+    mSeamlessPopupMenu->changeItem (devicesMenuId,
+        VBoxGlobal::iconSet ("diskim_16px.png"), tr ("&Devices"));
 #ifdef VBOX_WITH_DEBUGGER_GUI
     if (vboxGlobal().isDebuggerEnabled())
+    {
         menuBar()->changeItem (dbgMenuId, tr ("De&bug"));
+        mSeamlessPopupMenu->changeItem (dbgMenuId,
+            VBoxGlobal::iconSet ("global_settings_16px.png"), tr ("De&bug"));
+    }
 #endif
     menuBar()->changeItem (helpMenuId, tr ("&Help"));
+    mSeamlessPopupMenu->changeItem (helpMenuId,
+        VBoxGlobal::iconSet ("help_16px.png"), tr ("&Help"));
 
     /* status bar widgets */
@@ -1760,39 +1786,67 @@
 }
 
-//
-// Private slots
-/////////////////////////////////////////////////////////////////////////////
-
-void VBoxConsoleWnd::vmFullscreen (bool on)
-{
+void VBoxConsoleWnd::toggleFullscreenMode (bool aOn, bool aSeamless)
+{
+    if (aSeamless &&
+        (aOn && !mIsSeamlessModeSupported ||
+         aOn && mIsInFullscreenMode ||
+         !aOn && !mIsInSeamlessMode))
+        return;
+
     AssertReturnVoid (console);
-    AssertReturnVoid (full_screen != on);
-    AssertReturnVoid ((hidden_children.isEmpty() == on));
-
-    if (on)
-    {
-        /* take the Fullscreen hot key from the menu item */
-        QString hotKey = vmFullscreenAction->menuText();
+    AssertReturnVoid ((hidden_children.isEmpty() == aOn));
+    if (aSeamless)
+        AssertReturnVoid (mIsInSeamlessMode != aOn);
+    else
+        AssertReturnVoid (mIsInFullscreenMode != aOn);
+
+    if (aOn)
+    {
+        /* take the toggle hot key from the menu item */
+        QString hotKey = aSeamless ? vmSeamlessAction->menuText() :
+                                     vmFullscreenAction->menuText();
         hotKey = QStringList::split ('\t', hotKey) [1];
         Assert (!hotKey.isEmpty());
         /* get the host key name */
-        QString hostKey = QIHotKeyEdit::keyName (vboxGlobal().settings().hostKey());
+        QString hostKey = QIHotKeyEdit::keyName (vboxGlobal().settings()
+                                                             .hostKey());
         /* show the info message */
-        vboxProblem().remindAboutGoingFullscreen (hotKey, hostKey);
-    }
-
-    full_screen = on;
-
-    vmAdjustWindowAction->setEnabled (!on);
-    vmSeamlessAction->setEnabled (!on);
+        aSeamless ? vboxProblem().remindAboutGoingSeamless (hotKey, hostKey) :
+                    vboxProblem().remindAboutGoingFullscreen (hotKey, hostKey);
+    }
+
+    if (aSeamless)
+    {
+        /* activate the auto-resize feature required for the seamless mode */
+        if (!vmAutoresizeGuestAction->isOn())
+            vmAutoresizeGuestAction->setOn (true);
+
+        /* activate the mouse integration feature for the seamless mode */
+        if (vmDisableMouseIntegrAction->isOn())
+            vmDisableMouseIntegrAction->setOn (false);
+
+        vmAdjustWindowAction->setEnabled (!aOn);
+        vmFullscreenAction->setEnabled (!aOn);
+        vmAutoresizeGuestAction->setEnabled (!aOn);
+        vmDisableMouseIntegrAction->setEnabled (!aOn);
+    }
+    else
+    {
+        mIsInFullscreenMode = aOn;
+        vmAdjustWindowAction->setEnabled (!aOn);
+        vmSeamlessAction->setEnabled (!aOn);
+    }
 
     bool wasHidden = isHidden();
 
-    if (on)
-    {
+    if (aOn)
+    {
+        if (aSeamless)
+            mIsInSeamlessMode = true;
+
         /* Save the previous scroll-view minimum size before entering
-         * fullscreen state to restore this minimum size before the exiting
-         * fullscreen. Required for correct scroll-view and guest display
-         * update in SDL mode. */
+         * fullscreen/seamless state to restore this minimum size before
+         * the exiting fullscreen. Required for correct scroll-view and
+         * guest display update in SDL mode. */
         prev_min_size = console->minimumSize();
         console->setMinimumSize (0, 0);
@@ -1800,8 +1854,15 @@
         /* memorize the maximized state */
         was_max = isMaximized();
+
         /* set the correct flags to disable unnecessary frame controls */
-        int flags = WType_TopLevel | WStyle_Customize | WStyle_NoBorder |
-                    WStyle_StaysOnTop;
-        QRect scrGeo = QApplication::desktop()->screenGeometry (this);
+        int flags = WType_TopLevel | WStyle_Customize | WStyle_NoBorder;
+        if (!aSeamless)
+            flags |= WStyle_StaysOnTop;
+
+        /* let the widget take the whole available desktop space */
+        QRect scrGeo = aSeamless ?
+            QApplication::desktop()->availableGeometry (this) :
+            QApplication::desktop()->screenGeometry (this);
+
         /* hide early to avoid extra flicker */
         hide();
@@ -1821,9 +1882,11 @@
         }
         delete list;
-        /* reparet to apply new flags and place to the top left corner of the
+
+        /* reparent to apply new flags and place to the top left corner of the
          * current desktop */
         reparent (parentWidget(), flags, QPoint (scrGeo.x(), scrGeo.y()), false);
         /* reattaching application icon after window reparenting */
         setIcon (QPixmap::fromMimeSource ("ico40x01.png"));
+
         /* adjust colors and appearance */
         erase_color = centralWidget()->eraseColor();
@@ -1834,13 +1897,19 @@
         console->setVScrollBarMode (QScrollView::AlwaysOff);
         console->setHScrollBarMode (QScrollView::AlwaysOff);
+
         /* go fullscreen */
         resize (scrGeo.size());
         setMinimumSize (size());
         setMaximumSize (size());
+
 #ifdef Q_WS_MAC
-        /* make the apple menu bar go away. */
-        OSStatus orc = SetSystemUIMode (kUIModeAllHidden, kUIOptionDisableAppleMenu);
-        if (orc)
-            LogRel (("Error: Failed to change UI mode (rc=%#x) when changing to fullscreen mode. (=> menu bar trouble)\n", orc));
+        if (!aSeamless)
+        {
+            /* make the apple menu bar go away. */
+            OSStatus orc = SetSystemUIMode (kUIModeAllHidden,
+                                            kUIOptionDisableAppleMenu);
+            if (orc)
+                LogRel (("Error: Failed to change UI mode (rc=%#x) when changing to fullscreen mode. (=> menu bar trouble)\n", orc));
+        }
 #endif
     }
@@ -1852,13 +1921,19 @@
         console->setMinimumSize (prev_min_size);
 
+#ifdef Q_WS_MAC
+        if (!aSeamless)
+        {
+            SetSystemUIMode (kUIModeNormal, 0);
+        }
+#endif
+
         /* hide early to avoid extra flicker */
-#ifdef Q_WS_MAC
-        SetSystemUIMode (kUIModeNormal, 0);
-#endif
         hide();
-        /* reparet to restore normal flags */
+
+        /* reparent to restore normal flags */
         reparent (parentWidget(), normal_wflags, QPoint (0, 0), false);
         /* reattaching application icon after window reparenting */
         setIcon (QPixmap::fromMimeSource ("ico40x01.png"));
+
         /* adjust colors and appearance */
         centralWidget()->setEraseColor (erase_color);
@@ -1867,4 +1942,5 @@
         console->setVScrollBarMode (QScrollView::Auto);
         console->setHScrollBarMode (QScrollView::Auto);
+
         /* show everything hidden when going fullscreen */
         for (QObject *obj = hidden_children.first(); obj != NULL;
@@ -1872,16 +1948,39 @@
             ((QWidget *) obj)->show();
         hidden_children.clear();
+
         /* restore normal values */
         setMinimumSize (QSize(0, 0));
         setMaximumSize (QSize (QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
-        move (normal_pos);
-        resize (normal_size);
+
+        if (aSeamless)
+        {
+            if (was_max)
+            {
+                /* restore the maximized state */
+                setWindowState (windowState() | WindowMaximized);
+            }
+            else
+            {
+                move (normal_pos);
+                resize (normal_size);
+                QTimer::singleShot (200, console, SLOT (exitFullScreen()));
+            }
+        }
+        else
+        {
+            move (normal_pos);
+            resize (normal_size);
+            /* restore the maximized state */
+            if (was_max)
+                setWindowState (windowState() | WindowMaximized);
+            else
+                QTimer::singleShot (0, console, SLOT (exitFullScreen()));
+        }
+
         /* let our toplevel widget calculate its sizeHint properly */
         QApplication::sendPostedEvents (0, QEvent::LayoutHint);
-        /* restore the maximized state */
-        if (was_max)
-            setWindowState (windowState() | WindowMaximized);
-        else
-            QTimer::singleShot (0, console, SLOT (exitFullScreen()));
+
+        if (aSeamless)
+            mIsInSeamlessMode = false;
     }
 
@@ -1894,137 +1993,16 @@
 }
 
-void VBoxConsoleWnd::vmSeamless (bool on)
-{
-    if (on && !vmSeamlessAction->isEnabled() ||
-        !on && !mIsInSeamlessMode ||
-        on && full_screen)
-        return;
-
-    AssertReturnVoid (console);
-    AssertReturnVoid (mIsInSeamlessMode != on);
-    AssertReturnVoid ((hidden_children.isEmpty() == on));
-
-    if (on)
-    {
-        /* take the Seamless hot key from the menu item */
-        QString hotKey = vmSeamlessAction->menuText();
-        hotKey = QStringList::split ('\t', hotKey) [1];
-        Assert (!hotKey.isEmpty());
-        /* get the host key name */
-        QString hostKey = QIHotKeyEdit::keyName (vboxGlobal().settings().hostKey());
-        /* show the info message */
-        vboxProblem().remindAboutGoingSeamless (hotKey, hostKey);
-    }
-
-    /* activate the auto-resize feature required for the seamless mode */
-    if (!vmAutoresizeGuestAction->isOn())
-        vmAutoresizeGuestAction->setOn (true);
-
-    vmAdjustWindowAction->setEnabled (!on);
-    vmFullscreenAction->setEnabled (!on);
-    vmAutoresizeGuestAction->setEnabled (!on);
-
-    bool wasHidden = isHidden();
-
-    if (on)
-    {
-        mIsInSeamlessMode = true;
-
-        /* Save the previous scroll-view minimum size before entering
-         * seamless state to restore this minimum size before the exiting
-         * seamless mode. Required for correct scroll-view and guest display
-         * update in SDL mode. */
-        prev_min_size = console->minimumSize();
-        console->setMinimumSize (0, 0);
-
-        /* memorize the maximized state */
-        was_max = isMaximized();
-        /* set the correct flags to disable unnecessary frame controls */
-        int flags = WType_TopLevel | WStyle_Customize | WStyle_NoBorder;
-        /* let the widget take the whole available desktop space */
-        QRect scrGeo = QApplication::desktop()->availableGeometry (this);
-        /* hide early to avoid extra flicker */
-        hide();
-        /* hide all but the central widget containing the console view */
-        QObjectList *list = queryList (NULL, NULL, false, false);
-        for (QObject *obj = list->first(); obj != NULL; obj = list->next())
-        {
-            if (obj->isWidgetType() && obj != centralWidget())
-            {
-                QWidget *w = (QWidget *) obj;
-                if (!w->isHidden())
-                {
-                    w->hide();
-                    hidden_children.append (w);
-                }
-            }
-        }
-        delete list;
-        /* reparent to apply new flags and place to the top left corner of the
-         * current desktop */
-        reparent (parentWidget(), flags, QPoint (scrGeo.x(), scrGeo.y()), false);
-        /* reattaching application icon after window reparenting */
-        setIcon (QPixmap::fromMimeSource ("ico40x01.png"));
-        /* adjust colors and appearance */
-        console_style = console->frameStyle();
-        console->setFrameStyle (QFrame::NoFrame);
-        console->setMaximumSize (console->sizeHint());
-        console->setVScrollBarMode (QScrollView::AlwaysOff);
-        console->setHScrollBarMode (QScrollView::AlwaysOff);
-        /* go full available screen */
-        resize (scrGeo.size());
-        setMinimumSize (size());
-        setMaximumSize (size());
-    }
-    else
-    {
-        /* Restore the previous scroll-view minimum size before the exiting
-         * seamless mode. Required for correct scroll-view and guest display
-         * update in SDL mode. */
-        console->setMinimumSize (prev_min_size);
-
-        /* hide early to avoid extra flicker */
-        hide();
-        /* reparent to restore normal flags */
-        reparent (parentWidget(), normal_wflags, QPoint (0, 0), false);
-        /* reattaching application icon after window reparenting */
-        setIcon (QPixmap::fromMimeSource ("ico40x01.png"));
-        /* adjust colors and appearance */
-        console->setFrameStyle (console_style);
-        console->setMaximumSize (console->sizeHint());
-        console->setVScrollBarMode (QScrollView::Auto);
-        console->setHScrollBarMode (QScrollView::Auto);
-        /* show everything hidden when going fullscreen */
-        for (QObject *obj = hidden_children.first(); obj != NULL;
-             obj = hidden_children.next())
-            ((QWidget *) obj)->show();
-        hidden_children.clear();
-        /* restore normal values */
-        setMinimumSize (QSize(0, 0));
-        setMaximumSize (QSize (QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
-
-        if (was_max)
-        {
-            /* restore the maximized state */
-            setWindowState (windowState() | WindowMaximized);
-        }
-        else
-        {
-            move (normal_pos);
-            resize (normal_size);
-            QTimer::singleShot (0, console, SLOT (exitFullScreen()));
-        }
-        /* let our toplevel widget calculate its sizeHint properly */
-        QApplication::sendPostedEvents (0, QEvent::LayoutHint);
-
-        mIsInSeamlessMode = false;
-    }
-
-    /* VBoxConsoleView loses focus for some reason after reparenting,
-     * restore it */
-    console->setFocus();
-
-    if (!wasHidden)
-        show();
+//
+// Private slots
+/////////////////////////////////////////////////////////////////////////////
+
+void VBoxConsoleWnd::vmFullscreen (bool aOn)
+{
+    toggleFullscreenMode (aOn, false);
+}
+
+void VBoxConsoleWnd::vmSeamless (bool aOn)
+{
+    toggleFullscreenMode (aOn, true);
 }
 
@@ -2781,4 +2759,5 @@
     vmAutoresizeGuestAction->setEnabled (aActive);
     vmSeamlessAction->setEnabled (aSeamless);
+    mIsSeamlessModeSupported = aSeamless;
     if (aSeamless && vmSeamlessAction->isOn())
         vmSeamless (true);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp	(revision 3727)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp	(revision 3728)
@@ -281,7 +281,4 @@
     if (!rects)
         return E_POINTER;
-
-    if (!mView->isInSeamlessMode())
-        return S_OK;
 
     QRegion reg;
