Index: /trunk/src/VBox/Frontends/VirtualBox4/include/QITreeWidget.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/QITreeWidget.h	(revision 9866)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/QITreeWidget.h	(revision 9867)
@@ -37,11 +37,6 @@
     void setSupportedDropActions (Qt::DropActions aAction);
 
-signals:
-
-    void itemRightClicked (const QPoint &aPos, QTreeWidgetItem *aItem, int aColumn);
-
 protected:
 
-    void mousePressEvent (QMouseEvent *aEvent);
     virtual Qt::DropActions supportedDropActions () const;
 
Index: /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDiskImageManagerDlg.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDiskImageManagerDlg.h	(revision 9866)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDiskImageManagerDlg.h	(revision 9867)
@@ -92,5 +92,5 @@
     void processCurrentChanged (QTreeWidgetItem *aItem, QTreeWidgetItem *aPrevItem = NULL);
     void processDoubleClick (QTreeWidgetItem *aItem, int aColumn);
-    void processRightClick (const QPoint &aPos, QTreeWidgetItem *aItem, int aColumn);
+    void showContextMenu (const QPoint &aPos);
 
 private:
@@ -129,5 +129,5 @@
 
     void makeWarningMark (DiskImageItem *aItem, VBoxMedia::Status aStatus, VBoxDefs::DiskType aType) const;
-    
+
     static QString DVDImageUsage (const QUuid &aId, QString &aSnapshotUsage);
     static QString FloppyImageUsage (const QUuid &aId, QString &aSnapshotUsage);
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/QITreeWidget.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/QITreeWidget.cpp	(revision 9866)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/QITreeWidget.cpp	(revision 9867)
@@ -27,5 +27,5 @@
 
 QITreeWidget::QITreeWidget (QWidget *aParent)
-    : QTreeWidget (aParent) 
+    : QTreeWidget (aParent)
 {
 }
@@ -36,15 +36,5 @@
 }
 
-void QITreeWidget::mousePressEvent (QMouseEvent *aEvent)
-{
-    if (aEvent->button() == Qt::RightButton)
-    {
-        emit itemRightClicked (aEvent->globalPos(), itemAt (aEvent->pos()), columnAt (aEvent->pos().x()));
-        aEvent->accept();
-    }else
-        QTreeWidget::mousePressEvent (aEvent);
-}
-
-Qt::DropActions QITreeWidget::supportedDropActions () const
+Qt::DropActions QITreeWidget::supportedDropActions() const
 {
     return mSupportedDropActions;
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp	(revision 9866)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp	(revision 9867)
@@ -281,6 +281,6 @@
     connect (mHdsTree, SIGNAL (itemDoubleClicked (QTreeWidgetItem *, int)),
              this, SLOT (processDoubleClick (QTreeWidgetItem *, int)));
-    connect (mHdsTree, SIGNAL (itemRightClicked (const QPoint &, QTreeWidgetItem *, int)),
-             this, SLOT (processRightClick (const QPoint &, QTreeWidgetItem *, int)));
+    connect (mHdsTree, SIGNAL (customContextMenuRequested (const QPoint &)),
+             this, SLOT (showContextMenu (const QPoint &)));
 
     mCdsTree->header()->setResizeMode (0, QHeaderView::Stretch);
@@ -293,6 +293,6 @@
     connect (mCdsTree, SIGNAL (itemDoubleClicked (QTreeWidgetItem *, int)),
              this, SLOT (processDoubleClick (QTreeWidgetItem *, int)));
-    connect (mCdsTree, SIGNAL (itemRightClicked (const QPoint &, QTreeWidgetItem *, int)),
-             this, SLOT (processRightClick (const QPoint &, QTreeWidgetItem *, int)));
+    connect (mCdsTree, SIGNAL (customContextMenuRequested (const QPoint &)),
+             this, SLOT (showContextMenu (const QPoint &)));
 
     mFdsTree->header()->setResizeMode (0, QHeaderView::Stretch);
@@ -305,6 +305,6 @@
     connect (mFdsTree, SIGNAL (itemDoubleClicked (QTreeWidgetItem *, int)),
              this, SLOT (processDoubleClick (QTreeWidgetItem *, int)));
-    connect (mFdsTree, SIGNAL (itemRightClicked (const QPoint &, QTreeWidgetItem *, int)),
-             this, SLOT (processRightClick (const QPoint &, QTreeWidgetItem *, int)));
+    connect (mFdsTree, SIGNAL (customContextMenuRequested (const QPoint &)),
+             this, SLOT (showContextMenu (const QPoint &)));
 
     /* Context menu composing */
@@ -1576,11 +1576,13 @@
 }
 
-void VBoxDiskImageManagerDlg::processRightClick (const QPoint &aPos, QTreeWidgetItem *aItem, int /* aColumn */)
-{
-    if (aItem)
+void VBoxDiskImageManagerDlg::showContextMenu (const QPoint &aPos)
+{
+    QTreeWidget *curWidget = currentTreeWidget();
+    QTreeWidgetItem *curItem = curWidget->itemAt (aPos);
+    if (curItem)
     {
         /* Make sure the item is selected and current */
-        setCurrentItem (currentTreeWidget(), aItem);
-        mActionsContextMenu->exec (aPos);
+        setCurrentItem (curWidget, curItem);
+        mActionsContextMenu->exec (curWidget->viewport()->mapToGlobal (aPos));
     }
 }
