PopupMenu bug caused by border size being zero

Hi there, I made this post requesting settable border size for PopupMenus and the feature got added. I was making use of the feature when I discovered that setting the border size to 0 causes popup menus to be instantly closed upon opening in a certain case: when the popup menu is opened with a mouse button and is shown at the mouse position (the default).

When you press the mouse button down, it opens the popup menu. If the border size is 0, then when the popup menu opens, the mouse’s starting position is over the first item. And then when the right mouse button gets released, it interprets that as a click and selects the first item.

If the border size is 1 or more, the mouse’s starting position is on the border, so the popup menu remains open.

Why not open the PopupMenu on mouse release? That’s at least the standard behavior on Windows.

1 Like

Ah good point! I wasn’t aware that there was a mouseUp callback function. I was using mouseDown. Thanks for the sugguestion! I think this will solve the problem.

1 Like

Ok, but still that’s an open issue, because it changes the behavior of the popup menu depending on a totally unrelated aspect.

Also, on Mac the popup menus for right-clicks appear on mouse down, so I think it is a legitimate request to make them compatible with that behavior.

Maybe you could submit an issue on GitHub, so that someone in the JUCE team could have a look at this and report when this is fixed


I submitted an issue.

1 Like

This is fixed on develop now - 8b81379.

1 Like