diff --git a/plugins/vst_base/VstPlugin.cpp b/plugins/vst_base/VstPlugin.cpp index cada57293..31f171969 100644 --- a/plugins/vst_base/VstPlugin.cpp +++ b/plugins/vst_base/VstPlugin.cpp @@ -665,10 +665,7 @@ void VstPlugin::createUI( QWidget * parent, bool isEffect ) { QWindow* vw = QWindow::fromWinId(m_pluginWindowID); container = QWidget::createWindowContainer(vw, sw ); - RemotePlugin::showUI(); - // TODO: Synchronize show - // Tell remote that it is embedded - // Wait for remote reply + container->installEventFilter(this); } else #endif @@ -741,6 +738,20 @@ void VstPlugin::createUI( QWidget * parent, bool isEffect ) container->setFixedSize( m_pluginGeometry ); } +bool VstPlugin::eventFilter(QObject *obj, QEvent *event) +{ +#if QT_VERSION >= 0x050100 + if (embedMethod() == "qt" && obj == m_pluginWidget) + { + if (event->type() == QEvent::Show) { + RemotePlugin::showUI(); + } + qDebug() << obj << event; + } +#endif + return false; +} + QString VstPlugin::embedMethod() const { return m_embedMethod; diff --git a/plugins/vst_base/VstPlugin.h b/plugins/vst_base/VstPlugin.h index 4984d6849..f3d6bea8e 100644 --- a/plugins/vst_base/VstPlugin.h +++ b/plugins/vst_base/VstPlugin.h @@ -106,6 +106,7 @@ public: void toggleUI() override; void createUI( QWidget *parent, bool isEffect ); + bool eventFilter(QObject *obj, QEvent *event); QString embedMethod() const;