Menu selection disko in PT

Just tried the separators: no difference. Have you been able to reproduce it with my code?

I saw it happen once – but I’m going to try modifying it so it’s closer to mine to see if I can get it to happen more reliably.

Rail

Try this:

Rail

Sorry still can’t reproduce this. It must be a subtle race condition. I’ve tried reproducing this in Reaper, Logic Pro, Ableton Live and ProTools. I tried it on retina screens and non-retina, with large menus and small menus. Just can’t get it to happen here. I’m sure it’s a JUCE issue it’s just impossible to narrow down without it happening on my machine.

It happens when you move the mouse over the parents (not the children). Sometimes you’ll even get into a condition where if you’re between parents the child PopupMenu will flash on and off. Clicking on any parent ‘fixes’ it.

Are you testing a debug or release build? It may be more apparent in a Release build (the children are pretty slow to show on my iMac 3.4GHz i7 w/ 32GB RAM).

Rail

Hmmm I tried release, tried only the parent items, added a hundred submenu items. I still can’t reproduce this. I know it’s a lot of work, but I looked at the commits which could have potentially caused this bug and found the following commits. Can you try reverting the commits and see which one broke the menu behaviour for you:

http://github.com/WeAreROLI/JUCE/commits/ff474962fd302e3ec2568632045b7b4a7b960e3f
http://github.com/WeAreROLI/JUCE/commits/31e454f284b1b1ee4d91d22048f17020b8f00f87
http://github.com/WeAreROLI/JUCE/commits/9e356135a1afea04e1e1e975a3504173345fec7b
http://github.com/WeAreROLI/JUCE/commits/9f4648f85689ee5862291d57917a417a4613ef51
http://github.com/WeAreROLI/JUCE/commits/b574d4530ead35b8392cbc94310fd83e19e31f51
http://github.com/WeAreROLI/JUCE/commits/35b08ecec2e4e493cf5154f7ee579fb52c659175
http://github.com/WeAreROLI/JUCE/commits/2483c80529433b07498630bbde29ad4cfb8f337d
http://github.com/WeAreROLI/JUCE/commits/f866b4ff5e6269eb39fe59d022730f26b5ed57d8

I’ll make time tomorrow (later today) to try and step backwards through the commits to see if I can isolate the commit that caused it (if it exists).

Thanks,

Rail

Probably completely unrelated, but since it happens unreliably, maybe there are mouse events happening, that are jumping because of dust in the optics or alike? So that the flickering could be expected?
Just a thought…

I don’t think so – I tested an old build of my plug-in which was built with JUCE 4.x and I don’t see the same issue.

Cheers,

Rail

Sounds plausible, just wanted to rule out side effects…
Cheers!

No, I can reliably reproduce it here.

Out of interest - what size is your Screen and what resolution are you running?

Cheers,

Rail

Its 2560 x 1440, non-retina (but reports probably have a different resolution).

Hey just to give more information about this- I think it has to do with the window not getting system focus or a race condition where focus stays on the previous window. I’ve seen similar issues in Swift when trying to create dynamic popups and this would explain what’s going on. When the sub-menu windows are removed the OS is trying to give focus back to the previously selected window and if that hasn’t been established as the right one then everything gets screwy. The video should explain it more clearly than I can do with text: https://www.youtube.com/watch?v=hGyfehHY5r8

1 Like

Okay… This is the commit which causes the flashing…

https://github.com/WeAreROLI/JUCE/commit/7d98da98ea4ea811ca5b0bc4ca315b95d9bfc0d1

I had to change the code for the older commits (and also added more menu items to exacerbate the issue):

Rail

2 Likes

Thanks, @Rail_Jon_Rogut for your investigation!

@Roli: will we see a fix and when?
(I am asking because we are coordinating releases here and we need to decide if we have to apply our own fix to your framework. So an answer, that does not take a month is highly appreciated.)

We’re working on it…

1 Like

OK the commit was used for this bug:

I think the following patch fixes both but as I can’t reproduce the menu disco bug, can someone check if this patch actually fixes it:

FixMenuDisco.patch (2.7 KB)

Unfortunately that still causes flashes in a random parent when hovering over the parents in the PopupMenu… unless you click on any parent.

Thanks,

Rail

Damn… ok thank you. I’ll have to rethink this one.