From e400b7d395f0e0b6070b673dcb3a8167e64a46a0 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Tue, 14 Oct 2008 14:46:47 +0000 Subject: [PATCH] * DeskWindow wasn't checking if the context menu for the trash was already open and showing. We do it like in ContainerWindow now. Fixes #353 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28089 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/DeskWindow.cpp | 8 ++++---- src/kits/tracker/DeskWindow.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kits/tracker/DeskWindow.cpp b/src/kits/tracker/DeskWindow.cpp index 6a6ea7904d..54ccaa7a12 100644 --- a/src/kits/tracker/DeskWindow.cpp +++ b/src/kits/tracker/DeskWindow.cpp @@ -54,6 +54,7 @@ All rights reserved. #include "IconMenuItem.h" #include "MountMenu.h" #include "PoseView.h" +#include "SlowContextPopup.h" #include "Tracker.h" #include "TemplatesMenu.h" @@ -328,7 +329,7 @@ void BDeskWindow::AddTrashContextMenu() { // setup special trash context menu - fTrashContextMenu = new BPopUpMenu("TrashContext", false, false); + fTrashContextMenu = new BSlowContextMenu("TrashContext"); fTrashContextMenu->SetFont(be_plain_font); fTrashContextMenu->AddItem(new BMenuItem("Empty Trash", new BMessage(kEmptyTrash))); @@ -349,9 +350,8 @@ BDeskWindow::ShowContextMenu(BPoint loc, const entry_ref *ref, BView *view) DeleteSubmenu(fNavigationItem); if (ref && entry.SetTo(ref) == B_OK && FSIsTrashDir(&entry)) { - // - // don't show any menu if this is the trash - if (Dragging() && FSIsTrashDir(&entry)) + + if (fTrashContextMenu->IsShowing() || Dragging()) return; // selected item was trash, show the trash context menu instead diff --git a/src/kits/tracker/DeskWindow.h b/src/kits/tracker/DeskWindow.h index 9e95dee7e4..43ab1b5120 100644 --- a/src/kits/tracker/DeskWindow.h +++ b/src/kits/tracker/DeskWindow.h @@ -41,7 +41,7 @@ All rights reserved. #include "ContainerWindow.h" #include "DesktopPoseView.h" -class BPopUpMenu; +class BSlowContextMenu; namespace BPrivate { @@ -82,7 +82,7 @@ protected: private: BShelf *fDeskShelf; // shelf for replicant support - BPopUpMenu *fTrashContextMenu; + BSlowContextMenu *fTrashContextMenu; BRect fOldFrame;