Button with PopupMenu mouse state stuck


#1

Hello,

I’ve been having issues with this and it appears to be in the Juce Demo as well. Simply go to the Widgets section and click the “click for a popup menu…” button, whenever you get rid of the menu, the button will be stuck in the last state it was in. When you mouse over the button or click on a different button it gets fixed. In my code I’m opening the menu in a buttonClicked function. When I call isMouseOver on my button after the menu closes, it returns false as expected, yet if I call repaint it doesn’t repaint.

This is using the tip.

Thanks,
Sean


#2

There was a bug related to menus that got fixed:

http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=9060

You might try rolling back to a commit before the fix for the bug mentioned in that link and see if your defect is reproducible.


#3

The issue appears to have existed before the popup menu fix you’re referencing as well.


#4

Thanks - that was an interesting one! Fixed now.


#5

It seems to be working now on buttons where setTriggerOnMouseDown (true), but if you’re triggering your popup menu with mouse up it will get stuck on mouseOver.


#6

That’s not what I’m seeing… It seems to work fine now AFAICT (?)


#7

Weird… Well I just pulled again to make sure and I am indeed still getting this issue. I went into WidgetsDemo.cpp and did the following:

addAndMakeVisible (&menuButton);
menuButton.setBounds (10, 10, 200, 24);
menuButton.addListener (this);
//menuButton.setTriggeredOnMouseDown (true);

It’s quite subtle on the default look and feel but on my end it is definitely remaining in the wrong state. If I make a selection on the menu then mouse over the button, I will see no change in the button because it is already painted as mouse over. Moving out of the button will make it properly draw the mouse out state.


#8

Thanks - another subtle edge-case… Try now.


#9

Nice, looks good now.

Thanks Jules!