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();