From bdfed6c06fe3c62c3265b4c748b3d9795520ad80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 12 Oct 2006 12:48:16 +0000 Subject: [PATCH] While I couldn't reproduce bug #657 myself, this should fix it. TTeamMenuItem::AttachedToWindow() calls BView::SetFont() which entered the debugger if the menu was visible at the time. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19052 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/deskbar/TeamMenuItem.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/apps/deskbar/TeamMenuItem.cpp b/src/apps/deskbar/TeamMenuItem.cpp index f344581d1c..3a15e0b264 100644 --- a/src/apps/deskbar/TeamMenuItem.cpp +++ b/src/apps/deskbar/TeamMenuItem.cpp @@ -441,7 +441,12 @@ TTeamMenuItem::ToggleExpandState(bool resizeWindow) TWindowMenu *sub = (static_cast(Submenu())); if (sub) { // force the menu to update it's contents. - Submenu()->AttachedToWindow(); + bool locked = sub->LockLooper(); + // if locking the looper failed, the menu is just not visible + sub->AttachedToWindow(); + if (locked) + sub->UnlockLooper(); + if (sub->CountItems() > 1){ TExpandoMenuBar *parent = static_cast(Menu()); int myindex = parent->IndexOf(this) + 1;