From e90bed06b11d8bbfc1477952b63d5a7104fc1769 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sun, 2 Apr 2006 22:31:04 +0000 Subject: [PATCH] Fixed vlc menubars git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16975 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Menu.cpp | 10 +++++----- src/kits/interface/MenuBar.cpp | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 399b1e7e56..5bd942647f 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -961,7 +961,7 @@ BMenu::Track(bool openAnyway, BRect *clickToOpenRect) SetStickyMode(openAnyway); - if (LockLooper()) { + if (openAnyway && LockLooper()) { RedrawAfterSticky(Bounds()); UnlockLooper(); } @@ -1242,11 +1242,11 @@ BMenu::_AddItem(BMenuItem *item, int32 index) item->Install(window); // Make sure we update the layout if needed. - if (fResizeToFit) { + //if (fResizeToFit) { LayoutItems(index); //UpdateWindowViewSize(); Invalidate(); - } + //} window->Unlock(); } @@ -1303,7 +1303,7 @@ BMenu::RemoveItems(int32 index, int32 count, BMenuItem *item, bool deleteItems) } } - if (invalidateLayout && locked && fResizeToFit) { + if (invalidateLayout && locked /*&& fResizeToFit*/) { LayoutItems(0); Invalidate(); } @@ -1321,7 +1321,7 @@ BMenu::LayoutItems(int32 index) CalcTriggers(); float width, height; - ComputeLayout(index, true, true, &width, &height); + ComputeLayout(index, fResizeToFit, true, &width, &height); ResizeTo(width, height); diff --git a/src/kits/interface/MenuBar.cpp b/src/kits/interface/MenuBar.cpp index 086367b9af..baae94687e 100644 --- a/src/kits/interface/MenuBar.cpp +++ b/src/kits/interface/MenuBar.cpp @@ -70,7 +70,7 @@ BMenuBar::BMenuBar(BMessage *data) BMenuBar::~BMenuBar() { - if (fTrackingPID >= 0) { + if (fTracking) { status_t dummy; wait_for_thread(fTrackingPID, &dummy); } @@ -174,6 +174,9 @@ BMenuBar::MessageReceived(BMessage *msg) void BMenuBar::MouseDown(BPoint where) { + if (fTracking) + return; + BWindow *window = Window(); if (!window->IsActive() || !window->IsFront()) { window->Activate();