PopupMenu disappearing

Hi Jules,

There is a funny bug when one tries to display a sub-menu from multi-column menu: if the sub-menu is displayed over the parent menu (and not next to it, since the parent menu has two columns), when I mouse the mouse over the submenu, it disappears. It is related to mouse movements since keyboard navigation works fine. It is easy to reproduce that issue in the juce demo: in WidgetsDemo.cpp line 1244, add:

		for (int i=0; i < 100; ++i) m.addItem(300+i, "BALAI_BROSSE" + String(i));

Then you’ll have a two-columns menu and the bug is easy to spot. It does not appear on windows.

Ok I found a fix: adding this line in PopupMenu::Window::highlightItemUnderMouse

[code] if (disableMouseMoves)

  •    if (activeSubMenu && activeSubMenu->isOverChildren()) return;
      bool isMovingTowardsMenu = false;
      jassert (activeSubMenu == 0 || activeSubMenu->isValidComponent())


seems to fix it, but that definitively needs a review. I also don’t understand why this bug is mac only (maybe it is not… but I can’t test on windows right now)

Thanks - that does seem to make sense as a fix, I’ll try it out…