[haiku-commits] haiku: hrev48776 - src/apps/deskbar

  • From: jessica.l.hamilton@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 5 Feb 2015 21:25:34 +0100 (CET)

hrev48776 adds 1 changeset to branch 'master'
old head: 950ee98409129f2426576869746597866d25822b
new head: 85529c12b84a608d8cdc3e880922e3f60f2a4113
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=85529c12b84a+%5E950ee9840912

----------------------------------------------------------------------------

85529c12b84a: 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.

                         [ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev48776
Commit:      85529c12b84a608d8cdc3e880922e3f60f2a4113
URL:         http://cgit.haiku-os.org/haiku/commit/?id=85529c12b84a
Author:      Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date:        Thu Feb  5 20:07:19 2015 UTC

Ticket:      https://dev.haiku-os.org/ticket/3105

----------------------------------------------------------------------------

1 file changed, 1 insertion(+), 3 deletions(-)
src/apps/deskbar/BarWindow.cpp | 4 +---

----------------------------------------------------------------------------

diff --git a/src/apps/deskbar/BarWindow.cpp b/src/apps/deskbar/BarWindow.cpp
index f783376..f5af134 100644
--- a/src/apps/deskbar/BarWindow.cpp
+++ b/src/apps/deskbar/BarWindow.cpp
@@ -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();
        }
 }


Other related posts:

  • » [haiku-commits] haiku: hrev48776 - src/apps/deskbar - jessica . l . hamilton