From 6fbc00f0cebf70bf70d8785cbfce18732e1dc2f1 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 11 May 2015 12:55:35 +0100 Subject: [PATCH] Fix for linux VST hosting window creation --- .../format_types/juce_VSTPluginFormat.cpp | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 5f95662189..4788b34fb2 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -2086,6 +2086,14 @@ public: plugin.dispatch (effEditIdle, 0, 0, 0, 0); reentrant = false; } + + #if JUCE_LINUX + if (pluginWindow == 0) + { + updatePluginWindowHandle(); + componentMovedOrResized (true, true); + } + #endif } } @@ -2271,11 +2279,7 @@ private: } #elif JUCE_LINUX - pluginWindow = getChildWindow ((Window) getWindowHandle()); - - if (pluginWindow != 0) - pluginProc = (EventProcPtr) getPropertyFromXWindow (pluginWindow, - XInternAtom (display, "_XEventProc", False)); + updatePluginWindowHandle(); int w = 250, h = 150; @@ -2503,6 +2507,15 @@ private: sendEventToChild (ev); } } + + void updatePluginWindowHandle() + { + pluginWindow = getChildWindow ((Window) getWindowHandle()); + + if (pluginWindow != 0) + pluginProc = (EventProcPtr) getPropertyFromXWindow (pluginWindow, + XInternAtom (display, "_XEventProc", False)); + } #endif //==============================================================================