VST: Fix Qt-embedded VSTs not always appearing

This commit is contained in:
Lukas W
2017-11-29 14:45:29 +01:00
parent ae488b89cd
commit a446775c80
2 changed files with 16 additions and 4 deletions

View File

@@ -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;

View File

@@ -106,6 +106,7 @@ public:
void toggleUI() override;
void createUI( QWidget *parent, bool isEffect );
bool eventFilter(QObject *obj, QEvent *event);
QString embedMethod() const;