JuceDemoPlugin resizing glitches on Mac Ableton Live

With the latest tip, there are some really nasty repainting issues when resizing the 32-bit VST UI on Ableton Live for Mac. This is easily reproduced with the JuceDemoPlugin - just grab the handle and resize the window. See the attached screenshot for an example.


I am getting the same thing with Mac Live 9 VST 64 bit of Juce plugins, the VST version doesn't redraw properly when you drag the resizer quickly larger. The AU works fine. Any ideas?

I will look into this.

It looks to me that only one additional repaint is needed after the resizing, i.e. the plug-in always repaints according to the previous window size while resizing. This means that if you drag the resize icon slowly, the repainting of the plug-in is nearly correct (apart from 1px). Can you confirm that this is the bug you are seeing? Am I missing a more severe bug?

Issue should be fixed in newest commit. Does this work for you?

Hi Fabian, thanks for looking into this. Yes, moving the resizer fast makes issues worse. I already tried firing off a repaint and it didin't fix the issue. Can you please tell me the line of code you changed, or perhaps the commit message so I can track down what changed?

So it is working, but it also triggers a debug assertion:


void Component::setBounds (const int x, const int y, int w, int h)
    // if component methods are being called from threads other than the message
    // thread, you'll need to use a MessageManagerLock object to make sure it's thread-safe.
    if (w < 0) w = 0;
    if (h < 0) h = 0;
    const bool wasResized  = (getWidth() != w || getHeight() != h);
    const bool wasMoved    = (getX() != x || getY() != y);
    // It's a very bad idea to try to resize a window during its paint() method!
    jassert (! (flags.isInsidePaintCall && wasResized && isOnDesktop()));

I also found an identical redraw problem in the AAX plugin, where an extra repaint is needed to get the plugin to draw properly after a resize larger (edit: running on Mac OS 10.10, PT 11.2.1 Dev build)

OK, a new approach to fix this issue is commited in 4eecccfd92c7eaf72b4fd5f4d189f36986265891. Can you try this?