From 7828cad7537992e5fb5a459fa271e31f947ac0da Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 8 Nov 2021 19:28:25 +0000 Subject: [PATCH] VST2 Host: Fix window titlebar repainting when editor sizes change When opening the "settings" menu of Arturia Pigments VST2, the editor window would move itself over the JUCE non-native titlebar in the AudioPluginHost. Then, when the editor was moved back into the correct location, the titlebar would not be redrawn, leaving it in an incorrect state. This change forces a repaint of the editor's peer whenever the size changes, forcing the titlebar to repaint after the editor has moved. --- .../format_types/juce_VSTPluginFormat.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 007937fa2c..a319379673 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -2917,6 +2917,17 @@ public: 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER); + + MessageManager::callAsync ([ref = SafePointer (this)] + { + // Clean up after the editor window, in case it tried to move itself + // into the wrong location over this component. + if (ref == nullptr) + return; + + if (auto* p = ref->getPeer()) + p->repaint (p->getBounds().withPosition ({})); + }); } #elif JUCE_LINUX || JUCE_BSD if (pluginWindow != 0)