Deskbar: fix showing an empty leaf menu, #3105.

* NeedsToRebuild() didn't actually do anything, as this
  returns whether it needs to be rebuilt or not.
* Replaced RemoveItems() with ForceRebuild(), which should
  already delete the menu items, whilst additionally
  letting the leaf menu know that it needs to rebuild itself.

This bug was reproducible 100%; however, with this fix, there
is now a rare race condition where clicking between an app menu
and the leaf menu will result in both menus showing concurrently.
This commit is contained in:
Jessica Hamilton
2015-02-06 09:15:44 +13:00
parent 950ee98409
commit 85529c12b8
+1 -3
View File
@@ -136,7 +136,6 @@ TBarWindow::MenusBeginning()
return;
}
sDeskbarMenu->NeedsToRebuild();
sDeskbarMenu->ResetTargets();
fShowingMenu = true;
@@ -151,8 +150,7 @@ TBarWindow::MenusEnded()
BWindow::MenusEnded();
if (sDeskbarMenu->LockLooper()) {
// TODO: is this ok?
sDeskbarMenu->RemoveItems(0, sDeskbarMenu->CountItems(), true);
sDeskbarMenu->ForceRebuild();
sDeskbarMenu->UnlockLooper();
}
}