From 9f0ebbfcda6430a9e06505b43ad27c2959623e2d Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 21 Dec 2006 14:32:22 +0000 Subject: [PATCH] Call Window()->Show() in DetachedFromWindow() only if we were dragging, thus correctly mirroring what done in AttachedToWindow(). This caused the empty menu window in deskbar (trac is down, can't remember the right bug number), but I don't know why it happened only in haiku. Maybe in beos the looper->Lock() call never succeeded, due to slightly different locking strategy ? Axel, could you review this change ? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19589 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/deskbar/WindowMenu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apps/deskbar/WindowMenu.cpp b/src/apps/deskbar/WindowMenu.cpp index 179a247037..006c3cd7a6 100644 --- a/src/apps/deskbar/WindowMenu.cpp +++ b/src/apps/deskbar/WindowMenu.cpp @@ -212,13 +212,13 @@ TWindowMenu::DetachedFromWindow() // in expando mode the teammenu will not call DragStop, // thus, it needs to be called from here TBarView *barview = (dynamic_cast(be_app))->BarView(); - if (barview && barview->Expando()) { - BLooper *looper = barview->Looper(); - if (looper->Lock()) { - Window()->Show(); // We changed the show level in AttachedToWindow(). Undo it. - barview->DragStop(); - looper->Unlock(); + if (barview && barview->LockLooper()) { + if (barview->Expando() && barview->Dragging()) { + // We changed the show level in AttachedToWindow(). Undo it. + Window()->Show(); + barview->DragStop(); } + barview->UnlockLooper(); } BMenu::DetachedFromWindow();