We got a lot of Cubase 11 user reports where the GUI of our recently released plugin becomes extremely laggy – barely usable – when components are dragged around. The beachball appears and depending on the system, it takes up to some seconds until the GUI becomes responsible again. It took us some time to reconstruct this issue, since it does not occur on every machine.
After finally finding a mac where the problem appears, profiling revealed that at the timepoints where this happens, the message thread is frequently blocked for a long time and that this code path seems to be the culprit:
And indeed, simply commenting out these lines in
NSViewComponentPeer::toFront lets the issue disappear:
if (isSharedWindow) [[view superview] addSubview: view positioned: NSWindowAbove relativeTo: nil];
Disabling OpenGL for the plugin also lets the problem disappear. Currently, we only see this issue in Cubase 11 and no other host.
I don’t know anything about the native macOS GUI APIs, so I don’t even know exactly what the commented out block of code is actually doing and why it is necessary. The plugin seems to keep working as expected on a first glance. Finding this was pure try & error driven luck after examining the profiling data.
I’m not sure if I can make up a simple plugin to reproduce this issue, since I cannot even reproduce the issue with our plugin on my machine, but I’ll try my very best. In the meantime, does this ring a bell to any of the JUCE devs? We would be highly interested to get this fixed soon since this seem to affect a huge number of Cubase users which are not very happy with the state of things at the moment
Thanks in advance!