Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 55821)
@@ -5,5 +5,5 @@
 
 #
-# Copyright (C) 2006-2014 Oracle Corporation
+# Copyright (C) 2006-2015 Oracle Corporation
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -474,6 +474,5 @@
  ifdef VBOX_WITH_DRAG_AND_DROP_GH
   VirtualBox_QT_MOCHDRS += \
-	src/runtime/UIDnDMIMEData.h \
-	src/runtime/UIDnDDrag.h
+	src/runtime/UIDnDMIMEData.h
  endif
 endif
@@ -800,6 +799,5 @@
  ifdef VBOX_WITH_DRAG_AND_DROP_GH
   VirtualBox_SOURCES += \
-	src/runtime/UIDnDMIMEData.cpp \
-	src/runtime/UIDnDDrag.cpp
+	src/runtime/UIDnDMIMEData.cpp
   VirtualBox_SOURCES.win += \
 	src/runtime/UIDnDDropSource_win.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp	(revision 55821)
@@ -35,22 +35,18 @@
 #include <QStringList>
 
+#include "UIDnDHandler.h"
 #include "UIDnDDataObject_win.h"
 #include "UIDnDEnumFormat_win.h"
 
 
-UIDnDDataObject::UIDnDDataObject(CSession &session,
-                                 CDnDSource &dndSource,
-                                 const QStringList &lstFormats,
-                                 QWidget *pParent)
-    : mSession(session),
-      mDnDSource(dndSource),
-      mpParent(pParent),
-      mStatus(Uninitialized),
-      mRefCount(1),
-      mcFormats(0),
-      mpFormatEtc(NULL),
-      mpStgMedium(NULL),
-      mpvData(NULL),
-      mcbData(0)
+UIDnDDataObject::UIDnDDataObject(UIDnDHandler *pDnDHandler, const QStringList &lstFormats)
+    : m_pDnDHandler(pDnDHandler)
+    , mStatus(Uninitialized)
+    , mRefCount(1)
+    , mcFormats(0)
+    , mpFormatEtc(NULL)
+    , mpStgMedium(NULL)
+    , mpvData(NULL)
+    , mcbData(0)
 {
     HRESULT hr;
@@ -98,6 +94,6 @@
         }
 
-        LogFlowFunc(("Total registered native formats: %RU32 (for %d formats from guest)\n",
-                     cRegisteredFormats, lstFormats.size()));
+        LogRel3(("DnD: Total registered native formats: %RU32 (for %d formats from guest)\n",
+                 cRegisteredFormats, lstFormats.size()));
         hr = S_OK;
     }
@@ -208,7 +204,5 @@
     AssertPtrReturn(pMedium, DV_E_FORMATETC);
 
-#ifdef VBOX_DND_DEBUG_FORMATS
     LogFlowFunc(("pFormatEtc=%p, pMedium=%p\n", pFormatEtc, pMedium));
-#endif
 
     ULONG lIndex;
@@ -229,4 +223,5 @@
     if (mStatus == Dropping)
     {
+        LogRel3(("DnD: Dropping\n"));
         LogFlowFunc(("Waiting for event ...\n"));
         int rc2 = RTSemEventWait(mSemEvent, RT_INDEFINITE_WAIT);
@@ -236,9 +231,10 @@
     if (mStatus == Dropped)
     {
-        LogFlowFunc(("cfFormat=%RI16, sFormat=%s, tyMed=%RU32, dwAspect=%RU32\n",
-                     pThisFormat->cfFormat, UIDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
-                     pThisFormat->tymed, pThisFormat->dwAspect));
-        LogFlowFunc(("Got strFormat=%s, pvData=%p, cbData=%RU32\n",
-                     mstrFormat.toAscii().constData(), mpvData, mcbData));
+        LogRel3(("DnD: Dropped\n"));
+        LogRel3(("DnD: cfFormat=%RI16, sFormat=%s, tyMed=%RU32, dwAspect=%RU32\n",
+                 pThisFormat->cfFormat, UIDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
+                 pThisFormat->tymed, pThisFormat->dwAspect));
+        LogRel3(("DnD: Got strFormat=%s, pvData=%p, cbData=%RU32\n",
+                 mstrFormat.toAscii().constData(), mpvData, mcbData));
 
         QVariant::Type vaType;
@@ -286,16 +282,18 @@
         }
 #endif
-        LogFlowFunc(("strMIMEType=%s, vaType=%ld\n",
-                     strMIMEType.toAscii().constData(), vaType));
+        LogRel3(("DnD: strMIMEType=%s, vaType=%ld\n", strMIMEType.toAscii().constData(), vaType));
 
         int rc;
         if (!mVaData.isValid())
         {
-            rc = UIDnDDrag::RetrieveData(mSession,
-                                         mDnDSource,
-                                         /** @todo Support other actions. */
-                                         Qt::CopyAction,
-                                         strMIMEType, vaType, mVaData,
-                                         mpParent);
+            /* Note:  We're usig Qt::MoveAction because this speed up the whole operation
+             *        significantly: Instead of copying the data from the temporary location to
+             *        the final destination we just move it.
+             *
+             * Note2: The Qt::MoveAction *only* affects the behavior on the host! The desired
+             *        action for the guest (e.g. moving a file from guest to host) is not affected
+             *        by this setting. */
+            rc = m_pDnDHandler->retrieveData(Qt::MoveAction,
+                                             strMIMEType, vaType, mVaData);
         }
         else
@@ -652,9 +650,8 @@
             && pFormatEtc->dwAspect == mpFormatEtc[i].dwAspect)
         {
-#ifdef VBOX_DND_DEBUG_FORMATS
-            LogFlowFunc(("Format found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32, ulIndex=%RU32\n",
-                         pFormatEtc->tymed, pFormatEtc->cfFormat, UIDnDDataObject::ClipboardFormatToString(mpFormatEtc[i].cfFormat),
-                         pFormatEtc->dwAspect, i));
-#endif
+            LogRel3(("DnD: Format found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32, ulIndex=%RU32\n",
+                     pFormatEtc->tymed, pFormatEtc->cfFormat, UIDnDDataObject::ClipboardFormatToString(mpFormatEtc[i].cfFormat),
+                     pFormatEtc->dwAspect, i));
+
             if (puIndex)
                 *puIndex = i;
@@ -663,9 +660,8 @@
     }
 
-#ifdef VBOX_DND_DEBUG_FORMATS
-    LogFlowFunc(("Format NOT found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32\n",
-                 pFormatEtc->tymed, pFormatEtc->cfFormat, UIDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
-                 pFormatEtc->dwAspect));
-#endif
+    LogRel3(("DnD: Format NOT found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32\n",
+             pFormatEtc->tymed, pFormatEtc->cfFormat, UIDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
+             pFormatEtc->dwAspect));
+
     return false;
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h	(revision 55821)
@@ -31,5 +31,5 @@
 
 /* Forward declarations: */
-class UIDnDDrag;
+class UIDnDHandler;
 
 class UIDnDDataObject : public IDataObject
@@ -48,5 +48,5 @@
 public:
 
-    UIDnDDataObject(CSession &session, CDnDSource &dndSource, const QStringList &lstFormats, QWidget *pParent);
+    UIDnDDataObject(UIDnDHandler *pDnDHandler, const QStringList &lstFormats);
     virtual ~UIDnDDataObject(void);
 
@@ -84,26 +84,22 @@
                         LONG lindex = -1, DWORD dwAspect = DVASPECT_CONTENT, DVTARGETDEVICE *pTargetDevice = NULL);
 
-    QWidget    *mpParent;
-    CSession    mSession;
-    CDnDSource  mDnDSource;
-    Status      mStatus;
-    LONG        mRefCount;
-    /** Number of native formats registered. This
-     *  can be a different number than supplied with
-     *  mlstFormats. */
-    ULONG       mcFormats;
-    FORMATETC  *mpFormatEtc;
-    STGMEDIUM  *mpStgMedium;
-    RTSEMEVENT  mSemEvent;
-    QStringList mlstFormats;
-    QString     mstrFormat;
-    /** The retrieved data as a QVariant. Needed
-     *  for buffering in case a second format needs
-     *  the same data, e.g. CF_TEXT and CF_UNICODETEXT. */
-    QVariant    mVaData;
+    UIDnDHandler   *m_pDnDHandler;
+
+    Status          mStatus;
+    LONG            mRefCount;
+    /** Number of native formats registered. This can be a different number than supplied with mlstFormats. */
+    ULONG           mcFormats;
+    FORMATETC      *mpFormatEtc;
+    STGMEDIUM      *mpStgMedium;
+    RTSEMEVENT      mSemEvent;
+    QStringList     mlstFormats;
+    QString         mstrFormat;
+    /** The retrieved data as a QVariant. Needed for buffering in case a second format needs the same data,
+     *  e.g. CF_TEXT and CF_UNICODETEXT. */
+    QVariant        mVaData;
     /** The retrieved data as a raw buffer. */
-    void       *mpvData;
+    void           *mpvData;
     /** Raw buffer size (in bytes). */
-    uint32_t    mcbData;
+    uint32_t        mcbData;
 };
 
Index: unk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDrag.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDrag.cpp	(revision 55820)
+++ 	(revision )
@@ -1,217 +1,0 @@
-/* $Id$ */
-/** @file
- * VBox Qt GUI - UIDnDDrag class implementation. This class acts as a wrapper
- * for OS-dependent guest->host drag'n drop operations.
- */
-
-/*
- * Copyright (C) 2014 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifdef VBOX_WITH_PRECOMPILED_HEADERS
-# include <precomp.h>
-#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
-/* Qt includes: */
-# include <QApplication>
-# include <QFileInfo>
-# include <QKeyEvent>
-# include <QMimeData>
-# include <QStringList>
-# include <QTimer>
-# include <QUrl>
-
-/* GUI includes: */
-# include "UIDnDDrag.h"
-# include "UIDnDHandler.h"
-# include "UIDnDMIMEData.h"
-# include "UIMessageCenter.h"
-# ifdef RT_OS_WINDOWS
-#  include "UIDnDDropSource_win.h"
-#  include "UIDnDDataObject_win.h"
-# endif
-
-#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
-#undef LOG_GROUP
-#define LOG_GROUP LOG_GROUP_GUEST_DND
-#include <VBox/log.h>
-
-
-UIDnDDrag::UIDnDDrag(CSession &session,
-                     CDnDSource &dndSource,
-                     const QStringList &lstFormats,
-                     Qt::DropAction defAction, Qt::DropActions actions,
-                     QWidget *pParent /* = NULL */)
-    : m_session(session)
-    , m_dndSource(dndSource)
-    , m_lstFormats(lstFormats)
-    , m_defAction(defAction)
-    , m_actions(actions)
-    , m_pParent(pParent)
-#ifndef RT_OS_WINDOWS
-    , pMData(NULL)
-#endif
-{
-    LogFlowFunc(("m_defAction=0x%x\n", m_defAction));
-    LogFlowFunc(("Number of formats: %d\n", m_lstFormats.size()));
-#ifdef DEBUG
-    for (int i = 0; i < m_lstFormats.size(); i++)
-        LogFlowFunc(("\tFormat %d: %s\n", i, m_lstFormats.at(i).toAscii().constData()));
-#endif
-}
-
-int UIDnDDrag::DoDragDrop(void)
-{
-    LogFlowFunc(("pParent=0x%p\n", m_pParent));
-
-    int rc = VINF_SUCCESS;
-#ifdef RT_OS_WINDOWS
-    UIDnDDropSource *pDropSource = new UIDnDDropSource(m_pParent);
-    UIDnDDataObject *pDataObject = new UIDnDDataObject(m_session, m_dndSource, m_lstFormats, m_pParent);
-
-    DWORD dwOKEffects = DROPEFFECT_NONE;
-    if (m_actions)
-    {
-        if (m_actions & Qt::CopyAction)
-            dwOKEffects |= DROPEFFECT_COPY;
-        if (m_actions & Qt::MoveAction)
-            dwOKEffects |= DROPEFFECT_MOVE;
-        if (m_actions & Qt::LinkAction)
-            dwOKEffects |= DROPEFFECT_LINK;
-    }
-
-    DWORD dwEffect;
-    LogFlowFunc(("dwOKEffects=0x%x\n", dwOKEffects));
-    HRESULT hr = ::DoDragDrop(pDataObject, pDropSource,
-                              dwOKEffects, &dwEffect);
-    LogFlowFunc(("DoDragDrop ended with hr=%Rhrc, dwEffect=%RI32\n",
-                 hr, dwEffect));
-
-    if (pDropSource)
-        pDropSource->Release();
-    if (pDataObject)
-        pDataObject->Release();
-#else
-    QDrag *pDrag = new QDrag(m_pParent);
-
-    /* pMData is transfered to the QDrag object, so no need for deletion. */
-    pMData = new UIDnDMimeData(m_session, m_dndSource,
-                               m_lstFormats, m_defAction, m_actions,
-                               m_pParent);
-
-    /* Inform the MIME data object of any changes in the current action. */
-    connect(pDrag, SIGNAL(actionChanged(Qt::DropAction)),
-            pMData, SLOT(sltDropActionChanged(Qt::DropAction)));
-
-    /* Fire it up.
-     *
-     * On Windows this will start a modal operation using OLE's
-     * DoDragDrop() method, so this call will block until the DnD operation
-     * is finished. */
-    pDrag->setMimeData(pMData);
-#ifdef LOG_ENABLED
-    Qt::DropAction dropAction = pDrag->exec(m_actions, m_defAction);
-    LogFlowFunc(("dropAction=%ld\n", UIDnDHandler::toVBoxDnDAction(dropAction)));
-#endif
-
-     /* Note: The UIDnDMimeData object will not be not accessible here anymore,
-     *        since QDrag had its ownership and deleted it after the (blocking)
-     *        QDrag::exec() call. */
-#endif /* !RT_OS_WINDOWS */
-
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/* static */
-int UIDnDDrag::RetrieveData(const CSession &session,
-                            CDnDSource &dndSource,
-                            Qt::DropAction dropAction,
-                            const QString &strMimeType,
-                            QVariant::Type vaType, QVariant &vaData,
-                            QWidget *pParent)
-{
-    LogFlowFunc(("Retrieving data as type=%s (variant type=%ld)\n",
-                 strMimeType.toAscii().constData(), vaType));
-
-    int rc = VINF_SUCCESS;
-    CGuest guest = session.GetConsole().GetGuest();
-
-    /* Start getting the data from the source. Request and transfer data
-     * from the source and display a moddal progress dialog while doing this. */
-    CProgress progress = dndSource.Drop(strMimeType,
-                                        UIDnDHandler::toVBoxDnDAction(dropAction));
-    if (dndSource.isOk())
-    {
-        msgCenter().showModalProgressDialog(progress,
-                                            tr("Retrieving data ..."), ":/progress_dnd_gh_90px.png",
-                                            pParent);
-        if (!progress.GetCanceled())
-        {
-            rc =   (   progress.isOk()
-                    && progress.GetResultCode() == 0)
-                 ? VINF_SUCCESS : VERR_GENERAL_FAILURE; /** @todo Fudge; do a GetResultCode() to rc translation. */
-
-            if (RT_SUCCESS(rc))
-            {
-                /* After we successfully retrieved data from the source we query it from Main. */
-                QVector<uint8_t> vecData = dndSource.ReceiveData();
-                if (!vecData.isEmpty())
-                {
-                    switch (vaType)
-                    {
-                        case QVariant::String:
-                        {
-                            vaData = QVariant(QString(reinterpret_cast<const char*>(vecData.constData())));
-                            break;
-                        }
-
-                        case QVariant::ByteArray:
-                        {
-                            QByteArray ba(reinterpret_cast<const char*>(vecData.constData()), vecData.size());
-                            vaData = QVariant(ba);
-                            break;
-                        }
-
-                        case QVariant::StringList:
-                        {
-                            QString strData = QString(reinterpret_cast<const char*>(vecData.constData()));
-                            QStringList lstString = strData.split("\r\n", QString::SkipEmptyParts);
-
-                            vaData = QVariant(lstString);
-                            break;
-                        }
-
-                        default:
-                            rc = VERR_NOT_SUPPORTED;
-                            break;
-                    }
-                }
-                else
-                    rc = VERR_NO_DATA;
-            }
-            else
-                msgCenter().cannotDropDataToHost(progress, pParent);
-        }
-        else /* Don't pop up a message. */
-            rc = VERR_CANCELLED;
-    }
-    else
-    {
-        msgCenter().cannotDropDataToHost(dndSource, pParent);
-        rc = VERR_GENERAL_FAILURE; /** @todo Fudge; do a GetResultCode() to rc translation. */
-    }
-
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
Index: unk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDrag.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDrag.h	(revision 55820)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/* $Id$ */
-/** @file
- * VBox Qt GUI - UIDnDDrag class declaration.
- */
-
-/*
- * Copyright (C) 2014 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef ___UIDnDDrag_h___
-#define ___UIDnDDrag_h___
-
-/* Qt includes: */
-#include <QMimeData>
-
-/* COM includes: */
-#include "COMEnums.h"
-#include "CSession.h"
-#include "CConsole.h"
-#include "CDnDSource.h"
-#include "CGuest.h"
-
-#include "UIDnDHandler.h"
-
-/** @todo Subclass QWindowsMime / QMacPasteboardMime
- *  to register own/more MIME types. */
-
-/**
- * Implementation wrapper for OS-dependent drag'n drop
- * operations on the host.
- */
-class UIDnDDrag : public QObject
-{
-    Q_OBJECT;
-
-public:
-
-    UIDnDDrag(CSession &session, CDnDSource &dndSource,
-              const QStringList &lstFormats, Qt::DropAction defAction, Qt::DropActions actions,
-              QWidget *pParent = NULL);
-public:
-
-    int DoDragDrop(void);
-
-public:
-
-    static int RetrieveData(const CSession &session, CDnDSource &dndSource, Qt::DropAction dropAction, const QString &strMimeType, QVariant::Type vaType, QVariant &vaData, QWidget *pParent);
-
-private:
-
-    CSession          m_session;
-    CDnDSource        m_dndSource;
-    QStringList       m_lstFormats;
-    Qt::DropAction    m_defAction;
-    Qt::DropActions   m_actions;
-    QWidget          *m_pParent;
-#ifndef RT_OS_WINDOWS
-    UIDnDMimeData    *pMData;
-    friend class UIDnDMimeData;
-#endif
-};
-
-#endif /* ___UIDnDDrag_h___ */
-
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDropSource_win.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDropSource_win.h	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDropSource_win.h	(revision 55821)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2014 Oracle Corporation
+ * Copyright (C) 2014-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -46,8 +46,8 @@
 protected:
 
-    LONG mRefCount;
-    QWidget *mpParent;
-    DWORD mdwCurEffect;
-    Qt::DropActions muCurAction;
+    LONG             mRefCount;
+    QWidget         *mpParent;
+    DWORD            mdwCurEffect;
+    Qt::DropActions  muCurAction;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp	(revision 55821)
@@ -21,9 +21,16 @@
 
 /* Qt includes: */
-# include <QApplication>
-# include <QKeyEvent>
-# include <QStringList>
-# include <QTimer>
-# include <QUrl>
+#include <QApplication>
+#include <QKeyEvent>
+#include <QStringList>
+#include <QTimer>
+#include <QUrl>
+
+/* VirtualBox interface declarations: */
+#ifndef VBOX_WITH_XPCOM
+# include "VirtualBox.h"
+#else /* !VBOX_WITH_XPCOM */
+# include "VirtualBox_XPCOM.h"
+#endif /* VBOX_WITH_XPCOM */
 
 /* GUI includes: */
@@ -31,12 +38,18 @@
 #ifdef VBOX_WITH_DRAG_AND_DROP_GH
 # include "CDnDSource.h"
-# include "UIDnDDrag.h"
-#endif
-# include "UIMessageCenter.h"
+# ifdef RT_OS_WINDOWS
+#  include "UIDnDDataObject_win.h"
+#  include "UIDnDDropSource_win.h"
+# endif
+# include "UIDnDMIMEData.h"
+#endif /* VBOX_WITH_DRAG_AND_DROP_GH */
+#include "UIMessageCenter.h"
+#include "UISession.h"
 
 /* COM includes: */
 # include "CConsole.h"
-# include "CDnDTarget.h"
 # include "CGuest.h"
+# include "CGuestDnDSource.h"
+# include "CGuestDnDTarget.h"
 # include "CSession.h"
 
@@ -50,7 +63,19 @@
 
 
-UIDnDHandler *UIDnDHandler::m_pInstance = NULL;
-
-UIDnDHandler::UIDnDHandler(void)
+UIDnDHandler::UIDnDHandler(UISession *pSession, QWidget *pParent)
+    : m_pSession(pSession)
+    , m_pParent(pParent)
+    , m_enmMode(DNDMODE_UNKNOWN)
+    , m_fIsPending(false)
+#ifndef RT_OS_WINDOWS
+    , m_pMIMEData(NULL)
+#endif
+{
+    AssertPtr(pSession);
+    m_dndSource = static_cast<CDnDSource>(pSession->guest().GetDnDSource());
+    m_dndTarget = static_cast<CDnDTarget>(pSession->guest().GetDnDTarget());
+}
+
+UIDnDHandler::~UIDnDHandler(void)
 {
 }
@@ -60,18 +85,23 @@
  */
 
-Qt::DropAction UIDnDHandler::dragEnter(CDnDTarget &dndTarget, ulong screenId, int x, int y,
+Qt::DropAction UIDnDHandler::dragEnter(ulong screenID, int x, int y,
                                        Qt::DropAction proposedAction, Qt::DropActions possibleActions,
-                                       const QMimeData *pMimeData, QWidget * /* pParent = NULL */)
-{
-    LogFlowFunc(("screenId=%RU32, x=%d, y=%d, action=%ld\n",
-                 screenId, x, y, toVBoxDnDAction(proposedAction)));
+                                       const QMimeData *pMimeData)
+{
+    LogFlowFunc(("enmMode=%RU32, screenID=%RU32, x=%d, y=%d, action=%ld\n", 
+                 m_enmMode, screenID, x, y, toVBoxDnDAction(proposedAction)));
+
+    if (m_enmMode != DNDMODE_UNKNOWN)
+        return Qt::IgnoreAction;
 
     /* Ask the guest for starting a DnD event. */
-    KDnDAction result = dndTarget.Enter(screenId,
-                                        x,
-                                        y,
-                                        toVBoxDnDAction(proposedAction),
-                                        toVBoxDnDActions(possibleActions),
-                                        pMimeData->formats().toVector());
+    KDnDAction result = m_dndTarget.Enter(screenID,
+                                          x,
+                                          y,
+                                          toVBoxDnDAction(proposedAction),
+                                          toVBoxDnDActions(possibleActions),
+                                          pMimeData->formats().toVector());
+    if (result != KDnDAction_Ignore)
+        m_enmMode = DNDMODE_HOSTTOGUEST;
 
     /* Set the DnD action returned by the guest. */
@@ -79,44 +109,45 @@
 }
 
-Qt::DropAction UIDnDHandler::dragMove(CDnDTarget &dndTarget, ulong screenId, int x, int y,
+Qt::DropAction UIDnDHandler::dragMove(ulong screenID, int x, int y,
                                       Qt::DropAction proposedAction, Qt::DropActions possibleActions,
-                                      const QMimeData *pMimeData, QWidget * /* pParent = NULL */)
-{
-#ifdef DEBUG_andy
-    LogFlowFunc(("screenId=%RU32, x=%d, y=%d, action=%ld\n",
-                 screenId, x, y, toVBoxDnDAction(proposedAction)));
-#endif
+                                      const QMimeData *pMimeData)
+{
+    LogFlowFunc(("enmMode=%RU32, screenID=%RU32, x=%d, y=%d, action=%ld\n", 
+                 m_enmMode, screenID, x, y, toVBoxDnDAction(proposedAction)));
+
+    if (m_enmMode != DNDMODE_HOSTTOGUEST)
+        return Qt::IgnoreAction;
 
     /* Notify the guest that the mouse has been moved while doing
      * a drag'n drop operation. */
-    KDnDAction result = dndTarget.Move(screenId,
-                                       x,
-                                       y,
-                                       toVBoxDnDAction(proposedAction),
-                                       toVBoxDnDActions(possibleActions),
-                                       pMimeData->formats().toVector());
+    KDnDAction result = m_dndTarget.Move(screenID,
+                                         x,
+                                         y,
+                                         toVBoxDnDAction(proposedAction),
+                                         toVBoxDnDActions(possibleActions),
+                                         pMimeData->formats().toVector());
     /* Set the DnD action returned by the guest. */
     return toQtDnDAction(result);
 }
 
-Qt::DropAction UIDnDHandler::dragDrop(CSession &session, CDnDTarget &dndTarget,
-                                      ulong screenId, int x, int y,
+Qt::DropAction UIDnDHandler::dragDrop(ulong screenID, int x, int y,
                                       Qt::DropAction proposedAction, Qt::DropActions possibleActions,
-                                      const QMimeData *pMimeData, QWidget *pParent /* = NULL */)
-{
-    CGuest guest = session.GetConsole().GetGuest();
-
-    LogFlowFunc(("screenId=%RU32, x=%d, y=%d, action=%ld\n",
-                 screenId, x, y, toVBoxDnDAction(proposedAction)));
+                                      const QMimeData *pMimeData)
+{
+    LogFlowFunc(("enmMode=%RU32, screenID=%RU32, x=%d, y=%d, action=%ld\n", 
+                 m_enmMode, screenID, x, y, toVBoxDnDAction(proposedAction)));
+
+    if (m_enmMode != DNDMODE_HOSTTOGUEST)
+        return Qt::IgnoreAction;
 
     /* The format the guest requests. */
     QString format;
     /* Ask the guest for dropping data. */
-    KDnDAction result = dndTarget.Drop(screenId,
-                                       x,
-                                       y,
-                                       toVBoxDnDAction(proposedAction),
-                                       toVBoxDnDActions(possibleActions),
-                                       pMimeData->formats().toVector(), format);
+    KDnDAction result = m_dndTarget.Drop(screenID,
+                                         x,
+                                         y,
+                                         toVBoxDnDAction(proposedAction),
+                                         toVBoxDnDActions(possibleActions),
+                                         pMimeData->formats().toVector(), format);
     /* Has the guest accepted the drop event? */
     if (result != KDnDAction_Ignore)
@@ -132,7 +163,7 @@
             memcpy(dv.data(), d.constData(), d.size());
 
-            CProgress progress = dndTarget.SendData(screenId, format, dv);
-
-            if (dndTarget.isOk())
+            CProgress progress = m_dndTarget.SendData(screenID, format, dv);
+
+            if (m_dndTarget.isOk())
             {
                 LogFlowFunc(("Transferring data to guest ...\n"));
@@ -140,5 +171,5 @@
                 msgCenter().showModalProgressDialog(progress,
                                                     tr("Dropping data ..."), ":/progress_dnd_hg_90px.png",
-                                                    pParent);
+                                                    m_pParent);
 
                 LogFlowFunc(("Transfer fCompleted=%RTbool, fCanceled=%RTbool, hr=%Rhrc\n",
@@ -150,5 +181,5 @@
                         ||  progress.GetResultCode() != 0))
                 {
-                    msgCenter().cannotDropDataToGuest(progress, pParent);
+                    msgCenter().cannotDropDataToGuest(progress, m_pParent);
                     result = KDnDAction_Ignore;
                 }
@@ -156,5 +187,5 @@
             else
             {
-                msgCenter().cannotDropDataToGuest(dndTarget, pParent);
+                msgCenter().cannotDropDataToGuest(m_dndTarget, m_pParent);
                 result = KDnDAction_Ignore;
             }
@@ -165,9 +196,11 @@
 }
 
-void UIDnDHandler::dragLeave(CDnDTarget &dndTarget,
-                             ulong screenId, QWidget * /* pParent = NULL */)
-{
-    LogFlowFunc(("screenId=%RU32\n", screenId));
-    dndTarget.Leave(screenId);
+void UIDnDHandler::dragLeave(ulong screenID)
+{
+    LogFlowFunc(("enmMode=%RU32, screenID=%RU32\n", m_enmMode, screenID));
+    m_dndTarget.Leave(screenID);
+
+    if (m_enmMode == DNDMODE_HOSTTOGUEST)
+        m_enmMode = DNDMODE_UNKNOWN;
 }
 
@@ -176,10 +209,110 @@
  */
 
-int UIDnDHandler::dragIsPending(CSession &session, CDnDSource &dndSource,
-                                ulong screenId, QWidget *pParent /* = NULL */)
+int UIDnDHandler::dragStart(const QStringList &lstFormats,
+                            Qt::DropAction defAction, Qt::DropActions actions)
+{
+    m_lstFormats = lstFormats;
+    m_defAction  = defAction;
+    m_actions    = actions;
+
+    LogFlowFunc(("m_defAction=0x%x\n", m_defAction));
+    LogFlowFunc(("Number of formats: %d\n", m_lstFormats.size()));
+#ifdef DEBUG
+    for (int i = 0; i < m_lstFormats.size(); i++)
+        LogFlowFunc(("\tFormat %d: %s\n", i, m_lstFormats.at(i).toAscii().constData()));
+#endif
+
+    int rc = VINF_SUCCESS;
+
+#ifdef RT_OS_WINDOWS
+
+    UIDnDDropSource *pDropSource = new UIDnDDropSource(m_pParent);
+    if (!pDropSource)
+        return VERR_NO_MEMORY;
+    UIDnDDataObject *pDataObject = new UIDnDDataObject(this, m_lstFormats);
+    if (!pDataObject)
+        return VERR_NO_MEMORY;
+
+    DWORD dwOKEffects = DROPEFFECT_NONE;
+    if (m_actions)
+    {
+        if (m_actions & Qt::CopyAction)
+            dwOKEffects |= DROPEFFECT_COPY;
+        if (m_actions & Qt::MoveAction)
+            dwOKEffects |= DROPEFFECT_MOVE;
+        if (m_actions & Qt::LinkAction)
+            dwOKEffects |= DROPEFFECT_LINK;
+    }
+
+    DWORD dwEffect;
+    LogRel3(("DnD: dwOKEffects=0x%x\n", dwOKEffects));
+    HRESULT hr = ::DoDragDrop(pDataObject, pDropSource, dwOKEffects, &dwEffect);
+    LogRel3(("DnD: DoDragDrop ended with hr=%Rhrc, dwEffect=%RI32\n", hr, dwEffect));
+
+    if (pDropSource)
+        pDropSource->Release();
+    if (pDataObject)
+        pDataObject->Release();
+
+#else /* !RT_OS_WINDOWS */
+
+    QDrag *pDrag = new QDrag(m_pParent);
+    if (!pDrag)
+        return VERR_NO_MEMORY;
+
+    /* Note: pMData is transferred to the QDrag object, so no need for deletion. */
+    m_pMIMEData = new UIDnDMIMEData(this, m_lstFormats, m_defAction, m_actions);
+    if (!m_pMIMEData)
+    {
+        delete pDrag;
+        return VERR_NO_MEMORY;
+    }
+
+    /* Inform the MIME data object of any changes in the current action. */
+    connect(pDrag, SIGNAL(actionChanged(Qt::DropAction)),
+            m_pMIMEData, SLOT(sltDropActionChanged(Qt::DropAction)));
+
+    /*
+     * Set MIME data object and start the (modal) drag'n drop operation on the host.
+     * This does not block Qt's event loop, however (on Windows it would).
+     */
+    pDrag->setMimeData(m_pMIMEData);
+    Qt::DropAction dropAction = pDrag->exec(m_actions, m_defAction);
+    LogRel3(("DnD: Ended with dropAction=%ld\n", UIDnDHandler::toVBoxDnDAction(dropAction)));
+
+    /* Note: The UIDnDMimeData object will not be not accessible here anymore,
+     *       since QDrag had its ownership and deleted it after the (blocking)
+     *       QDrag::exec() call. */
+
+    /* pDrag will be cleaned up by Qt automatically. */
+
+#endif /* !RT_OS_WINDOWS */
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+int UIDnDHandler::dragIsPending(ulong screenID)
 {
     int rc;
 #ifdef VBOX_WITH_DRAG_AND_DROP_GH
-    /*
+  
+    LogFlowFunc(("enmMode=%RU32, m_fIsPending=%RTbool, screenID=%RU32\n", m_enmMode, m_fIsPending, screenID));
+
+    {
+        QMutexLocker AutoReadLock(&m_ReadLock);
+
+        if (m_enmMode != DNDMODE_UNKNOWN) /* Wrong mode set? */
+            return VINF_SUCCESS;
+
+        if (m_fIsPending) /* Pendig operation is in progress. */
+            return VINF_SUCCESS;
+    }
+
+    QMutexLocker AutoWriteLock(&m_ReadLock);
+    m_fIsPending = true;
+    AutoWriteLock.unlock();
+
+    /**
      * How this works: Source is asking the target if there is any DnD
      * operation pending, when the mouse leaves the guest window. On
@@ -187,11 +320,14 @@
      * (or defaultAction is KDnDAction_Ignore if not). With
      * this information we create a Qt QDrag object with our own QMimeType
-     * implementation and call exec. Please note, this *blocks* until the DnD
-     * operation has finished.
+     * implementation and call exec.
+     *
+     * Note: This function *blocks* until the actual drag'n drop operation
+     *       has been finished (successfully or not)!
      */
-    CGuest guest = session.GetConsole().GetGuest();
+    CGuest guest = m_pSession->guest();
+
     QVector<QString> vecFmtGuest;
     QVector<KDnDAction> vecActions;
-    KDnDAction defaultAction = dndSource.DragIsPending(screenId, vecFmtGuest, vecActions);
+    KDnDAction defaultAction = m_dndSource.DragIsPending(screenID, vecFmtGuest, vecActions);
     LogFlowFunc(("defaultAction=%d, numFormats=%d\n", defaultAction, vecFmtGuest.size()));
 
@@ -199,5 +335,5 @@
     if (defaultAction != KDnDAction_Ignore)
     {
-        /*
+        /**
          * Do guest -> host format conversion, if needed.
          * On X11 this already maps to the Xdnd protocol.
@@ -206,12 +342,11 @@
          * See: https://www.iana.org/assignments/media-types/media-types.xhtml
          */
-        LogFlowFunc(("Number of guest formats: %d\n", vecFmtGuest.size()));
+        LogRel3(("DnD: Number of guest formats: %d\n", vecFmtGuest.size()));
         for (int i = 0; i < vecFmtGuest.size(); i++)
         {
             const QString &strFmtGuest = vecFmtGuest.at(i);
-            LogFlowFunc(("\tFormat %d: %s\n", i,
-                         strFmtGuest.toAscii().constData()));
+            LogRel3(("\tFormat %d: %s\n", i, strFmtGuest.toAscii().constData()));
 # ifdef RT_OS_WINDOWS
-            /* CF_TEXT */
+            /* CF_TEXT -> Regular text. */
             if (   strFmtGuest.contains("text/plain", Qt::CaseInsensitive)
                 && !lstFmtNative.contains("text/plain"))
@@ -219,5 +354,5 @@
                 lstFmtNative << "text/plain";
             }
-            /* CF_HDROP */
+            /* CF_HDROP -> URI list. */
             else if (   strFmtGuest.contains("text/uri-list", Qt::CaseInsensitive)
                      && !lstFmtNative.contains("text/uri-list"))
@@ -225,43 +360,135 @@
                 lstFmtNative << "text/uri-list";
             }
-# else
+# else /* RT_OS_WINDOWS */
+
             /* On non-Windows just do a 1:1 mapping. */
             lstFmtNative << strFmtGuest;
 #  ifdef RT_OS_MACOS
-            /** @todo Does the mapping apply here? Don't think so ... */
+            /** @todo Does the 1:1 format mapping apply on OS X? Needs testing! */
 #  endif
+
 # endif /* !RT_OS_WINDOWS */
         }
 
-        LogFlowFunc(("Number of native formats: %d\n", lstFmtNative.size()));
-# ifdef DEBUG
+        LogRel3(("DnD: Number of native formats: %d\n", lstFmtNative.size()));
         for (int i = 0; i < lstFmtNative.size(); i++)
-            LogFlowFunc(("\tFormat %d: %s\n", i, lstFmtNative.at(i).toAscii().constData()));
-# endif
+            LogRel3(("\tFormat %d: %s\n", i, lstFmtNative.at(i).toAscii().constData()));
     }
 
     if (!lstFmtNative.isEmpty())
     {
-        UIDnDDrag *pDrag = new UIDnDDrag(session, dndSource, lstFmtNative,
-                                         toQtDnDAction(defaultAction),
-                                         toQtDnDActions(vecActions), pParent);
-        if (pDrag)
-        {
-            rc = pDrag->DoDragDrop();
-            delete pDrag;
-        }
-        else
-            rc = VERR_NO_MEMORY;
+        rc = dragStart(lstFmtNative,
+                       toQtDnDAction(defaultAction), toQtDnDActions(vecActions));          
     }
     else /* No format data from the guest arrived yet. */
         rc = VERR_NO_DATA;
+
+    AutoWriteLock.relock();
+    m_fIsPending = false;
+    AutoWriteLock.unlock();
+
 #else /* !VBOX_WITH_DRAG_AND_DROP_GH */
-    NOREF(dndSource);
-    NOREF(session);
-    NOREF(screenId);
-    NOREF(pParent);
+
+    NOREF(screenID);
 
     rc = VERR_NOT_SUPPORTED;
+
 #endif /* VBOX_WITH_DRAG_AND_DROP_GH */
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+/**
+ * Called by UIDnDMIMEData (Linux, OS X, Solaris) or UIDnDDataObject (Windows)
+ * to start retrieving the actual data from the guest. This function will block
+ * and show a modal progress dialog until the data transfer is complete.
+ *
+ * @return IPRT return code.
+ * @param dropAction            Drop action to perform.
+ * @param strMimeType           MIME data type.
+ * @param vaType                Qt's variant type of the MIME data.
+ * @param vaData                The actual MIME data.
+ * @param pParent               Pointer to parent widget.
+ */
+int UIDnDHandler::retrieveData(      Qt::DropAction  dropAction,
+                               const QString        &strMimeType,
+                                     QVariant::Type  vaType,
+                                     QVariant       &vaData)
+{
+    LogFlowFunc(("Retrieving data as type=%s (variant type=%ld)\n",
+                 strMimeType.toAscii().constData(), vaType));
+
+    int rc = VINF_SUCCESS;
+
+    /* Start getting the data from the source. Request and transfer data
+     * from the source and display a modal progress dialog while doing this. */
+    Assert(!m_dndSource.isNull());
+    CProgress progress = m_dndSource.Drop(strMimeType,
+                                          UIDnDHandler::toVBoxDnDAction(dropAction));
+    if (m_dndSource.isOk())
+    {
+        msgCenter().showModalProgressDialog(progress,
+                                            tr("Retrieving data ..."), ":/progress_dnd_gh_90px.png",
+                                            m_pParent);
+
+        LogFlowFunc(("fCanceled=%RTbool, fCompleted=%RTbool, isOk=%RTbool, hrc=%Rhrc\n", 
+                     progress.GetCanceled(), progress.GetCompleted(), progress.isOk(), progress.GetResultCode()));
+
+        if (!progress.GetCanceled())
+        {
+            rc =   (   progress.isOk()
+                    && progress.GetResultCode() == 0)
+                 ? VINF_SUCCESS : VERR_GENERAL_FAILURE; /** @todo Fudge; do a GetResultCode() to rc translation. */
+
+            if (RT_SUCCESS(rc))
+            {
+                /* After we successfully retrieved data from the source we query it from Main. */
+                QVector<uint8_t> vecData = m_dndSource.ReceiveData();
+                if (!vecData.isEmpty())
+                {
+                    switch (vaType)
+                    {
+                        case QVariant::String:
+                        {
+                            vaData = QVariant(QString(reinterpret_cast<const char*>(vecData.constData())));
+                            break;
+                        }
+
+                        case QVariant::ByteArray:
+                        {
+                            QByteArray ba(reinterpret_cast<const char*>(vecData.constData()), vecData.size());
+                            vaData = QVariant(ba);
+                            break;
+                        }
+
+                        case QVariant::StringList:
+                        {
+                            QString strData = QString(reinterpret_cast<const char*>(vecData.constData()));
+                            QStringList lstString = strData.split("\r\n", QString::SkipEmptyParts);
+
+                            vaData = QVariant(lstString);
+                            break;
+                        }
+
+                        default:
+                            rc = VERR_NOT_SUPPORTED;
+                            break;
+                    }
+                }
+                else
+                    rc = VERR_NO_DATA;
+            }
+            else
+                msgCenter().cannotDropDataToHost(progress, m_pParent);
+        }
+        else /* Don't pop up a message. */
+            rc = VERR_CANCELLED;
+    }
+    else
+    {
+        msgCenter().cannotDropDataToHost(m_dndSource, m_pParent);
+        rc = VERR_GENERAL_FAILURE; /** @todo Fudge; do a GetResultCode() to rc translation. */
+    }
 
     LogFlowFuncLeaveRC(rc);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.h	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.h	(revision 55821)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2011-2014 Oracle Corporation
+ * Copyright (C) 2011-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -19,14 +19,19 @@
 #define ___UIDnDHandler_h___
 
+/* Qt includes: */
+#include <QMimeData>
+#include <QMutex>
+#include <QStringList>
+
 /* COM includes: */
 #include "COMEnums.h"
+#include "CDnDTarget.h"
+#include "CDnDSource.h"
 
 /* Forward declarations: */
 class QMimeData;
-class CDnDSource;
-class CDnDTarget;
-class CGuest;
-class CSession;
-class UIDnDMimeData;
+
+class UIDnDMIMEData;
+class UISession;
 
 class UIDnDHandler: public QObject
@@ -36,43 +41,33 @@
 public:
 
-    /* Singleton factory. */
-    static UIDnDHandler *instance(void)
-    {
-        if (!m_pInstance)
-            m_pInstance = new UIDnDHandler();
-        return m_pInstance;
-    }
-
-    static void destroy(void)
-    {
-        if (m_pInstance)
-        {
-            delete m_pInstance;
-            m_pInstance = NULL;
-        }
-    }
+    UIDnDHandler(UISession *pSession, QWidget *pParent);
+    virtual ~UIDnDHandler(void);
 
     /**
      * Current operation mode.
      */
-    enum Direction
+    typedef enum DNDMODE
     {
         /** Unknown mode. */
-        Unknown = 0,
+        DNDMODE_UNKNOWN     = 0,
         /** Host to guest. */
-        HostToGuest,
+        DNDMODE_HOSTTOGUEST = 1,
         /** Guest to host. */
-        GuestToHost
+        DNDMODE_GUESTTOHOST = 2,
         /** @todo Implement guest to guest. */
-    };
+        /** The usual 32-bit type blow up. */
+        DNDMODE_32BIT_HACK = 0x7fffffff
+    } DNDMODE;
 
     /* Frontend -> Target. */
-    Qt::DropAction             dragEnter(CDnDTarget &dndTarget, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL);
-    Qt::DropAction             dragMove (CDnDTarget &dndTarget, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL);
-    Qt::DropAction             dragDrop (CSession &session, CDnDTarget &dndTarget, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL);
-    void                       dragLeave(CDnDTarget &dndTarget, ulong screenId, QWidget *pParent = NULL);
+    Qt::DropAction             dragEnter(ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData);
+    Qt::DropAction             dragMove (ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData);
+    Qt::DropAction             dragDrop (ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData);
+    void                       dragLeave(ulong screenId);
 
     /* Source -> Frontend. */
-    int                        dragIsPending(CSession &session, CDnDSource &dndSource, ulong screenId, QWidget *pParent = NULL);
+    int                        dragIsPending(ulong screenId);
+    int                        dragStart(const QStringList &lstFormats, Qt::DropAction defAction, Qt::DropActions actions);
+    int                        retrieveData(Qt::DropAction  dropAction, const QString &strMimeType, QVariant::Type vaType, QVariant &vaData);
 
 public:
@@ -83,18 +78,36 @@
     static Qt::DropActions     toQtDnDActions(const QVector<KDnDAction> &vecActions);
 
-private:
+protected:
 
-    UIDnDHandler(void);
-    virtual ~UIDnDHandler(void) {}
+    /** Pointer to UI session. */
+    UISession        *m_pSession;
+    /** Pointer to parent widget. */
+    QWidget          *m_pParent;
 
-private:
+    /** Drag and drop source instance. */
+    CDnDSource        m_dndSource;
+    /** Drag and drop target instance. */
+    CDnDTarget        m_dndTarget;
+    /** Current transfer direction. */
+    DNDMODE           m_enmMode;
+    /** Flag indicating if a drag operation is pending currently. */
+    bool              m_fIsPending;
+    QMutex            m_ReadLock;
+    QMutex            m_WriteLock;
 
-    /** Static pointer to singleton instance. */
-    static UIDnDHandler *m_pInstance;
+    /** List of formats supported by the source. */
+    QStringList       m_lstFormats;
+    /** Default drop action from the source. */
+    Qt::DropAction    m_defAction;
+    /** List of allowed drop actions from the source. */
+    Qt::DropActions   m_actions;
+
+#ifndef RT_OS_WINDOWS
+    /** Pointer to MIMEData instance used for handling
+     *  own MIME times on non-Windows host OSes. */
+    UIDnDMIMEData    *m_pMIMEData;
+    friend class UIDnDMIMEData;
+#endif
 };
-
-/** Gets the singleton instance of the drag'n drop UI helper class. */
-#define DnDHandler() UIDnDHandler::instance()
-
 #endif /* ___UIDnDHandler_h___ */
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.cpp	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.cpp	(revision 55821)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2011-2014 Oracle Corporation
+ * Copyright (C) 2011-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -31,5 +31,4 @@
 /* GUI includes: */
 # include "UIDnDMIMEData.h"
-# include "UIDnDDrag.h"
 # include "UIMessageCenter.h"
 
@@ -41,15 +40,10 @@
 
 
-UIDnDMimeData::UIDnDMimeData(CSession &session,
-                             CDnDSource &dndSource,
-                             QStringList formats,
-                             Qt::DropAction defAction, Qt::DropActions actions,
-                             QWidget *pParent)
-    : m_Session(session)
-    , m_DnDSource(dndSource)
-    , m_lstFormats(formats)
+UIDnDMIMEData::UIDnDMIMEData(UIDnDHandler *pDnDHandler,
+                             QStringList lstFormats, Qt::DropAction defAction, Qt::DropActions actions)
+    : m_pDnDHandler(pDnDHandler)
+    , m_lstFormats(lstFormats)
     , m_defAction(defAction)
     , m_actions(actions)
-    , m_pParent(pParent)
     , m_enmState(Dragging)
     , m_vaData(QVariant::Invalid)
@@ -57,5 +51,11 @@
     LogFlowThisFuncEnter();
 
-    /*
+#ifdef DEBUG
+    LogFlowFunc(("Number of formats: %d\n", lstFormats.size()));
+    for (int i = 0; i < lstFormats.size(); i++)
+        LogFlowFunc(("\tFormat %d: %s\n", i, lstFormats.at(i).toAscii().constData()));
+#endif
+
+     /**
      * This is unbelievable hacky, but I didn't find another way. Stupid
      * Qt QDrag interface is so less verbose, that we in principle know
@@ -83,39 +83,34 @@
      *       and will take care of all the input handling. */
 #ifndef RT_OS_WINDOWS
+    /* Install the event filter in a deferred way. */
     QTimer::singleShot(0, this, SLOT(sltInstallEventFilter()));
 #endif
-
-#ifdef DEBUG
-    LogFlowFunc(("Number of formats: %d\n", formats.size()));
-    for (int i = 0; i < formats.size(); i++)
-        LogFlowFunc(("\tFormat %d: %s\n", i, formats.at(i).toAscii().constData()));
-#endif
-}
-
-void UIDnDMimeData::sltDropActionChanged(Qt::DropAction dropAction)
-{
-    LogFlowFunc(("dropAction=0x%x\n", dropAction));
-    m_defAction = dropAction;
-}
-
-QStringList UIDnDMimeData::formats(void) const
+}
+
+QStringList UIDnDMIMEData::formats(void) const
 {
     return m_lstFormats;
 }
 
-bool UIDnDMimeData::hasFormat(const QString &strMIMEType) const
+bool UIDnDMIMEData::hasFormat(const QString &strMIMEType) const
 {
     bool fRc = m_lstFormats.contains(strMIMEType);
     LogFlowFunc(("%s: %RTbool (QtMimeData: %RTbool)\n",
-                 strMIMEType.toStdString().c_str(),
-                 fRc, QMimeData::hasFormat(strMIMEType)));
+                 strMIMEType.toStdString().c_str(), fRc, QMimeData::hasFormat(strMIMEType)));
     return fRc;
 }
 
-QVariant UIDnDMimeData::retrieveData(const QString &strMIMEType,
-                                     QVariant::Type vaType)
-{
-    LogFlowFunc(("m_enmState=%d, mimeType=%s, type=%d (%s)\n",
-                 m_enmState, strMIMEType.toStdString().c_str(),
+/**
+ * Called by Qt's drag'n drop operation (QDrag) for retrieving the actual drag'n drop
+ * data in case of a successful drag'n drop operation.
+ *
+ * @param strMIMEType           MIME type string.
+ * @param vaType                Variant containing the actual data based on the the MIME type.
+ *
+ * @return QVariant
+ */
+QVariant UIDnDMIMEData::retrieveData(const QString &strMIMEType, QVariant::Type vaType) const
+{
+    LogFlowFunc(("state=%RU32, mimeType=%s, type=%d (%s)\n", m_enmState, strMIMEType.toStdString().c_str(),
                  vaType, QVariant::typeToName(vaType)));
 
@@ -139,6 +134,5 @@
         && !m_lstFormats.contains(strMIMEType))
     {
-        LogFlowFunc(("Unsupported MIME type=%s\n",
-                     strMIMEType.toStdString().c_str()));
+        LogRel3(("DnD: Unsupported MIME type=%s\n", strMIMEType.toStdString().c_str()));
         fCanDrop = false;
     }
@@ -154,59 +148,42 @@
              || vaType == QVariant::List))
     {
-        LogFlowFunc(("Unsupported data type=%d (%s)\n",
-                     vaType, QVariant::typeToName(vaType)));
+        LogRel3(("DnD: Unsupported data type=%d (%s)\n", vaType, QVariant::typeToName(vaType)));
         fCanDrop = false;
     }
 
+    LogRel3(("DnD: State=%ld, fCanDrop=%RTbool\n", m_enmState, fCanDrop));
+
     if (!fCanDrop)
     {
-        LogFlowFunc(("Skipping request, m_enmState=%d ...\n",
-                     m_enmState));
+        LogFlowFunc(("Skipping request, state=%RU32 ...\n", m_enmState));
         return QMimeData::retrieveData(strMIMEType, vaType);
     }
 
-    int rc = VINF_SUCCESS;
-    if (m_enmState == Dropped)
-    {
-        rc = UIDnDDrag::RetrieveData(m_Session,
-                                     m_DnDSource,
-                                     m_defAction,
-                                     strMIMEType, vaType, m_vaData,
-                                     m_pParent);
-        if (RT_SUCCESS(rc))
-        {
-            /* Tell ourselves that data became available. */
-            emit sigDataAvailable(strMIMEType);
-        }
-        else
-        {
-            m_enmState = Canceled;
-        }
-    }
-
-    LogFlowFunc(("Returning rc=%Rrc, m_enmState=%ld\n",
-                 rc, m_enmState));
+    /* Note: The const_cast is used because this function needs to be const (otherwise
+     *       Qt won't call it), but we need the stuff in an unconst'ed way. */
+    int rc = const_cast<UIDnDMIMEData *>(this)->retrieveDataInternal(strMIMEType, vaType);
+
+    LogFlowFunc(("Returning rc=%Rrc, state=%RU32\n", rc, m_enmState));
     return m_vaData;
 }
 
 #ifndef RT_OS_WINDOWS
-bool UIDnDMimeData::eventFilter(QObject *pObject, QEvent *pEvent)
-{
+bool UIDnDMIMEData::eventFilter(QObject *pObject, QEvent *pEvent)
+{
+    bool fRemoveFilter = false;
+
     if (pEvent)
     {
         switch (pEvent->type())
         {
-#ifdef DEBUG_andy
             case QEvent::MouseMove:
             {
                 QMouseEvent *pMouseEvent = (QMouseEvent*)(pEvent);
                 AssertPtr(pMouseEvent);
-                LogFlowFunc(("MouseMove: x=%d, y=%d\n",
-                             pMouseEvent->globalX(), pMouseEvent->globalY()));
-
-                return true;
-                /* Never reached. */
+                LogFlowFunc(("MouseMove: x=%d, y=%d\n", pMouseEvent->globalX(), pMouseEvent->globalY()));
+
+                break;
             }
-#endif
+
             case QEvent::MouseButtonRelease:
             {
@@ -214,6 +191,6 @@
                 m_enmState = Dropped;
 
-                return true;
-                /* Never reached. */
+                fRemoveFilter = true;
+                break;
             }
 
@@ -223,10 +200,10 @@
                 if (static_cast<QKeyEvent*>(pEvent)->key() == Qt::Key_Escape)
                 {
-                    LogFlowFunc(("ESC pressed, cancelling drag and drop operation\n"));
+                    LogRel2(("DnD: ESC pressed, cancelling drag and drop operation\n"));
                     m_enmState = Canceled;
+
+                    fRemoveFilter = true;
                 }
-
-                return true;
-                /* Never reached. */
+                break;
             }
 
@@ -236,16 +213,17 @@
     }
 
+    if (fRemoveFilter)
+    {
+        LogFlowFunc(("Removing event filter ...\n"));
+        AssertPtr(qApp);
+        qApp->removeEventFilter(this);
+    }
+
+    /* Do normal processing by Qt. */
     return QObject::eventFilter(pObject, pEvent);
 }
-
-void UIDnDMimeData::sltInstallEventFilter(void)
-{
-    LogFlowFunc(("Installing event filter ...\n"));
-    AssertPtr(qApp);
-    qApp->installEventFilter(this);
-}
-#endif /* RT_OS_WINDOWS */
-
-int UIDnDMimeData::setData(const QString &mimeType)
+#endif /* !RT_OS_WINDOWS */
+
+int UIDnDMIMEData::setData(const QString &mimeType)
 {
     LogFlowFunc(("mimeType=%s, dataType=%s\n",
@@ -275,9 +253,9 @@
             {
                 QFileInfo fileInfo(lstData.at(i).toString());
-#ifdef DEBUG
+
                 LogFlowFunc(("\tURL: %s (fExists=%RTbool, fIsDir=%RTbool, cb=%RU64)\n",
                              fileInfo.absoluteFilePath().constData(), fileInfo.exists(),
                              fileInfo.isDir(), fileInfo.size()));
-#endif
+
                 lstURL << QUrl::fromLocalFile(fileInfo.absoluteFilePath());
             }
@@ -298,2 +276,45 @@
 }
 
+int UIDnDMIMEData::retrieveDataInternal(const QString &strMIMEType, QVariant::Type vaType)
+{
+    LogFlowFunc(("state=%RU32, mimeType=%s, type=%d (%s)\n", m_enmState,
+                  strMIMEType.toStdString().c_str(), vaType, QVariant::typeToName(vaType)));
+
+    AssertPtr(m_pDnDHandler);
+    int rc = m_pDnDHandler->retrieveData(m_defAction, strMIMEType, vaType, m_vaData);
+    if (RT_SUCCESS(rc))
+    {
+        /* Nothing to do here yet. */
+    }
+    else if (rc == VERR_CANCELLED)
+        m_enmState = Canceled;
+    else
+        m_enmState = Error;
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+/**
+ * Issued by the QDrag object as soon as the current drop action has changed.
+ *
+ * @param dropAction            New drop action to use.
+ */
+void UIDnDMIMEData::sltDropActionChanged(Qt::DropAction dropAction)
+{
+    LogFlowFunc(("dropAction=0x%x\n", dropAction));
+    m_defAction = dropAction;
+}
+
+#ifndef RT_OS_WINDOWS
+/**
+ * Issued by ourselves to install the event filter.
+ */
+void UIDnDMIMEData::sltInstallEventFilter(void)
+{
+    LogFlowFunc(("Installing event filter ...\n"));
+    AssertPtr(qApp);
+    qApp->installEventFilter(this);
+}
+#endif
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.h	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.h	(revision 55821)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2011-2014 Oracle Corporation
+ * Copyright (C) 2011-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -31,7 +31,4 @@
 #include "UIDnDHandler.h"
 
-/* Forward declarations: */
-class UIDnDDrag;
-
 /** @todo Subclass QWindowsMime / QMacPasteboardMime
  *  to register own/more MIME types. */
@@ -41,5 +38,5 @@
  * handling all guest-to-host transfers.
  */
-class UIDnDMimeData: public QMimeData
+class UIDnDMIMEData: public QMimeData
 {
     Q_OBJECT;
@@ -55,10 +52,14 @@
         Dropped,
         /** The operation has been canceled. */
-        Canceled
+        Canceled,
+        /** An error occurred. */
+        Error,
+        /** The usual 32-bit type blow up. */
+        State_32BIT_Hack = 0x7fffffff
     };
 
 public:
 
-    UIDnDMimeData(CSession &session, CDnDSource &dndSource, QStringList formats, Qt::DropAction defAction, Qt::DropActions actions, QWidget *pParent);
+    UIDnDMIMEData(UIDnDHandler *pDnDHandler, QStringList formats, Qt::DropAction defAction, Qt::DropActions actions);
 
 public:
@@ -77,5 +78,5 @@
     virtual bool hasFormat(const QString &mimeType) const;
 
-    virtual QVariant retrieveData(const QString &mimeType, QVariant::Type type);
+    virtual QVariant retrieveData(const QString &mimeType, QVariant::Type type) const;
 
 #ifndef RT_OS_WINDOWS
@@ -84,9 +85,7 @@
     /** @}  */
 
-signals:
+    int retrieveDataInternal(const QString &strMIMEType, QVariant::Type vaType);
 
-    void sigDataAvailable(const QString &mimeType) const;
-
-private slots:
+protected slots:
 
 #ifndef RT_OS_WINDOWS
@@ -94,12 +93,12 @@
 #endif
 
-private:
+protected:
 
-    CSession          m_Session;
-    CDnDSource        m_DnDSource;
+    UIDnDHandler     *m_pDnDHandler;
+
     QStringList       m_lstFormats;
     Qt::DropAction    m_defAction;
     Qt::DropActions   m_actions;
-    QWidget          *m_pParent;
+
     mutable State     m_enmState;
     mutable QVariant  m_vaData;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 55821)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2010-2012 Oracle Corporation
+ * Copyright (C) 2010-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -101,4 +101,5 @@
 
 
+/* static */
 UIMachineView* UIMachineView::create(  UIMachineWindow *pMachineWindow
                                      , ulong uScreenId
@@ -163,7 +164,7 @@
     pMachineView->sltMachineStateChanged();
     /** @todo Can we move the call to sltAdditionsStateChanged() from the
-     * subclass constructors here too?  It is called for Normal and Seamless,
-     * but not for Fullscreen and Scale.  However for Scale it is a no op.,
-     * so it would not hurt.  Would it hurt for Fullscreen? */
+     *        subclass constructors here too?  It is called for Normal and Seamless,
+     *        but not for Fullscreen and Scale.  However for Scale it is a no op.,
+     *        so it would not hurt.  Would it hurt for fullscreen? */
 
     /* Set a preliminary maximum size: */
@@ -173,6 +174,14 @@
 }
 
+/* static */
 void UIMachineView::destroy(UIMachineView *pMachineView)
 {
+    if (!pMachineView)
+        return;
+
+#ifdef VBOX_WITH_DRAG_AND_DROP
+    if (pMachineView->m_pDnDHandler)
+        delete pMachineView->m_pDnDHandler;
+#endif
     delete pMachineView;
 }
@@ -675,6 +684,10 @@
 
 #ifdef VBOX_WITH_DRAG_AND_DROP
-    /* Enable Drag & Drop. */
+    /* Enable drag & drop. */
     setAcceptDrops(true);
+
+    /* Create the drag and drop handler instance.
+     * At the moment we only support one instance per machine window. */
+    m_pDnDHandler = new UIDnDHandler(uisession(), this /* pParent */);
 #endif /* VBOX_WITH_DRAG_AND_DROP */
 }
@@ -1402,4 +1415,11 @@
 
 #ifdef VBOX_WITH_DRAG_AND_DROP
+/**
+ * Host -> Guest: Issued when the host cursor enters the guest (VM) window.
+ *                The guest will receive the relative cursor coordinates of the
+ *                appropriate screen ID.
+ *
+ * @param pEvent                Related enter event.
+ */
 void UIMachineView::dragEnterEvent(QDragEnterEvent *pEvent)
 {
@@ -1409,14 +1429,38 @@
     const QPoint &cpnt = viewportToContents(pEvent->pos());
 
-    CDnDTarget dndTarget = static_cast<CDnDTarget>(guest().GetDnDTarget());
-
     /* Ask the target for starting a DnD event. */
-    Qt::DropAction result = DnDHandler()->dragEnter(dndTarget,
-                                                    screenId(),
+    Qt::DropAction result = m_pDnDHandler->dragEnter(screenId(),
+                                                     frameBuffer()->convertHostXTo(cpnt.x()),
+                                                     frameBuffer()->convertHostYTo(cpnt.y()),
+                                                     pEvent->proposedAction(),
+                                                     pEvent->possibleActions(),
+                                                     pEvent->mimeData());
+
+    /* Set the DnD action returned by the guest. */
+    pEvent->setDropAction(result);
+    pEvent->accept();
+}
+
+/**
+ * Host -> Guest: Issued when the host cursor moves inside (over) the guest (VM) window.
+ *                The guest will receive the relative cursor coordinates of the
+ *                appropriate screen ID.
+ *
+ * @param pEvent                Related move event.
+ */
+void UIMachineView::dragMoveEvent(QDragMoveEvent *pEvent)
+{
+    AssertPtrReturnVoid(pEvent);
+
+    /* Get mouse-pointer location. */
+    const QPoint &cpnt = viewportToContents(pEvent->pos());
+
+    /* Ask the guest for moving the drop cursor. */
+    Qt::DropAction result = m_pDnDHandler->dragMove(screenId(),
                                                     frameBuffer()->convertHostXTo(cpnt.x()),
                                                     frameBuffer()->convertHostYTo(cpnt.y()),
                                                     pEvent->proposedAction(),
                                                     pEvent->possibleActions(),
-                                                    pEvent->mimeData(), this /* pParent */);
+                                                    pEvent->mimeData());
 
     /* Set the DnD action returned by the guest. */
@@ -1425,5 +1469,36 @@
 }
 
-void UIMachineView::dragMoveEvent(QDragMoveEvent *pEvent)
+/**
+ * Host -> Guest: Issued when the host cursor leaves the guest (VM) window again.
+ *                This will ask the guest to stop any further drag'n drop operation.
+ *
+ * @param pEvent                Related leave event.
+ */
+void UIMachineView::dragLeaveEvent(QDragLeaveEvent *pEvent)
+{
+    AssertPtrReturnVoid(pEvent);
+
+    m_pDnDHandler->dragLeave(screenId());
+
+    pEvent->accept();
+}
+
+/**
+ * Guest -> Host: Checks for a pending drag and drop event within the guest
+ *                and (optionally) starts a drag and drop operation on the host.
+ */
+void UIMachineView::dragIsPending(void)
+{
+    /** @todo Add guest->guest DnD functionality here by getting
+     *        the source of guest B (when copying from B to A). */
+    m_pDnDHandler->dragIsPending(screenId());
+}
+
+/**
+ * Host -> Guest: Issued when the host drops data into the guest (VM) window.
+ *
+ * @param pEvent                Related drop event.
+ */
+void UIMachineView::dropEvent(QDropEvent *pEvent)
 {
     AssertPtrReturnVoid(pEvent);
@@ -1432,61 +1507,11 @@
     const QPoint &cpnt = viewportToContents(pEvent->pos());
 
-    CDnDTarget dndTarget = static_cast<CDnDTarget>(guest().GetDnDTarget());
-
-    /* Ask the guest for moving the drop cursor. */
-    Qt::DropAction result = DnDHandler()->dragMove(dndTarget,
-                                                   screenId(),
-                                                   frameBuffer()->convertHostXTo(cpnt.x()),
-                                                   frameBuffer()->convertHostYTo(cpnt.y()),
-                                                   pEvent->proposedAction(),
-                                                   pEvent->possibleActions(),
-                                                   pEvent->mimeData(), this /* pParent */);
-
-    /* Set the DnD action returned by the guest. */
-    pEvent->setDropAction(result);
-    pEvent->accept();
-}
-
-void UIMachineView::dragLeaveEvent(QDragLeaveEvent *pEvent)
-{
-    AssertPtrReturnVoid(pEvent);
-
-    CDnDTarget dndTarget = static_cast<CDnDTarget>(guest().GetDnDTarget());
-
-    /* Ask the guest for stopping this DnD event. */
-    DnDHandler()->dragLeave(dndTarget,
-                            screenId(), this /* pParent */);
-    pEvent->accept();
-}
-
-void UIMachineView::dragIsPending(void)
-{
-    /** @todo Add guest->guest DnD functionality here by getting
-     *        the source of guest B (when copying from B to A). */
-    CDnDSource dndSource = static_cast<CDnDSource>(guest().GetDnDSource());
-
-    /* Check for a pending DnD event within the guest and if so, handle all the
-     * magic. */
-    DnDHandler()->dragIsPending(session(), dndSource, screenId(), this /* pParent */);
-}
-
-void UIMachineView::dropEvent(QDropEvent *pEvent)
-{
-    AssertPtrReturnVoid(pEvent);
-
-    /* Get mouse-pointer location. */
-    const QPoint &cpnt = viewportToContents(pEvent->pos());
-
-    CDnDTarget dndTarget = static_cast<CDnDTarget>(guest().GetDnDTarget());
-
     /* Ask the guest for dropping data. */
-    Qt::DropAction result = DnDHandler()->dragDrop(session(),
-                                                   dndTarget,
-                                                   screenId(),
-                                                   frameBuffer()->convertHostXTo(cpnt.x()),
-                                                   frameBuffer()->convertHostYTo(cpnt.y()),
-                                                   pEvent->proposedAction(),
-                                                   pEvent->possibleActions(),
-                                                   pEvent->mimeData(), this /* pParent */);
+    Qt::DropAction result = m_pDnDHandler->dragDrop(screenId(),
+                                                    frameBuffer()->convertHostXTo(cpnt.x()),
+                                                    frameBuffer()->convertHostYTo(cpnt.y()),
+                                                    pEvent->proposedAction(),
+                                                    pEvent->possibleActions(),
+                                                    pEvent->mimeData());
 
     /* Set the DnD action returned by the guest. */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 55820)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 55821)
@@ -24,6 +24,9 @@
 
 /* GUI includes: */
+#ifdef VBOX_WITH_DRAG_AND_DROP
+# include "UIDnDHandler.h"
+#endif
+#include "UIExtraDataDefs.h"
 #include "UIMachineDefs.h"
-#include "UIExtraDataDefs.h"
 #ifdef Q_WS_MAC
 # include <CoreFoundation/CFBase.h>
@@ -309,4 +312,9 @@
     QPixmap m_pausePixmapScaled;
 
+#ifdef VBOX_WITH_DRAG_AND_DROP
+    /** Pointer to drag and drop handler instance. */
+    UIDnDHandler *m_pDnDHandler;
+#endif
+
     /* Friend classes: */
     friend class UIKeyboardHandler;
