Applied patch by Ziusudra in ticket #4930 to avoid a deadlock when

navigating the menus via keyboard.
I also factored some code into functions, in particular the code to
add the dynamic items. Also keep track if the dynamic items have been added
or not (using a new boolean class member).
I tested for regressions but couldn't find any.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37261 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2010-06-26 12:29:17 +00:00
parent cfb281bd72
commit 780b76dcf9
2 changed files with 94 additions and 38 deletions
+12 -4
View File
@@ -183,7 +183,8 @@ private:
BMenu& operator=(const BMenu& other);
void _InitData(BMessage* archive);
bool _Show(bool selectFirstItem = false);
bool _Show(bool selectFirstItem = false,
bool keyDown = false);
void _Hide();
BMenuItem* _Track(int* action, long start = -1);
@@ -235,18 +236,22 @@ private:
void _Uninstall();
void _SelectItem(BMenuItem* item,
bool showSubmenu = true,
bool selectFirstItem = false);
bool selectFirstItem = false,
bool keyDown = false);
bool _SelectNextItem(BMenuItem* item, bool forward);
BMenuItem* _NextItem(BMenuItem* item, bool forward) const;
void _SetIgnoreHidden(bool on);
void _SetStickyMode(bool on);
bool _IsStickyMode() const;
void _GetIsAltCommandKey(bool &value) const;
void _CalcTriggers();
bool _ChooseTrigger(const char* title, int32& index,
uint32& trigger,
BPrivate::TriggerList& triggers);
void _UpdateWindowViewSize(const bool &updatePosition);
bool _OkToProceed(BMenuItem* item);
bool _AddDynamicItems();
bool _OkToProceed(BMenuItem* item,
bool keyDown = false);
bool _CustomTrackingWantsToQuit();
@@ -277,7 +282,10 @@ private:
LayoutData* fLayoutData;
int32 _reserved;
bool fDynamicItemsAdded;
bool _reserved1;
bool _reserved2;
bool _reserved3;
char fTrigger;
bool fResizeToFit;