BMenuBar & Deskbar: Make the hack to call ShowMenuBar a lot less ugly.

The previous hack, which as the comment (and __MWERKS__) implies
dates all the way back to the Be era, finally broke: int32 is "int"
on non-x86, not "long", and so this generated an undefined symbol
error on ARM.

The best solution seems to be to make StartMenuBar merely protected,
and then make a subclass where it is fully public to call it.
This is a lot less fragile (and much less ugly.)

Change-Id: I0519d0d9eeb1cc4523d0c6dd4fdfe8688ed1092c
Reviewed-on: https://review.haiku-os.org/c/1516
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Augustin Cavalier
2019-06-17 11:49:48 +00:00
committed by waddlesplash
parent 581a586f95
commit 74c38cab40
2 changed files with 17 additions and 28 deletions
+5 -6
View File
@@ -79,6 +79,11 @@ public:
virtual status_t Perform(perform_code code, void* data);
protected:
void StartMenuBar(int32 menuIndex,
bool sticky = true, bool showMenu = false,
BRect* special_rect = NULL);
private:
friend class BWindow;
friend class BMenuField;
@@ -91,12 +96,6 @@ private:
BMenuBar &operator=(const BMenuBar &);
// TODO: Tracker uses this function so we can't change
// its signature without breaking it
void StartMenuBar(int32 menuIndex,
bool sticky = true, bool showMenu = false,
BRect* special_rect = NULL);
static int32 _TrackTask(void *arg);
BMenuItem* _Track(int32 *action, int32 startIndex = -1,
bool showMenu = false);