diff --git a/interface/src/ui/InteractiveWindow.cpp b/interface/src/ui/InteractiveWindow.cpp index 8225e5f438..f8961c6de1 100644 --- a/interface/src/ui/InteractiveWindow.cpp +++ b/interface/src/ui/InteractiveWindow.cpp @@ -70,7 +70,7 @@ void QmlWindowProxy::parentNativeWindowToMainWindow() { } void InteractiveWindowProxy::emitScriptEvent(const QVariant& scriptMessage){ - // emit scriptEventReceived(scriptMessage); + emit scriptEventReceived(scriptMessage); } void InteractiveWindowProxy::emitWebEvent(const QVariant& webMessage) { @@ -137,11 +137,11 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap presentationMode = (InteractiveWindowPresentationMode) properties[PRESENTATION_MODE_PROPERTY].toInt(); } - _interactiveWindowProxy = std::make_unique(); - QObject::connect(_interactiveWindowProxy.get(), &InteractiveWindowProxy::webEventReceived, - this, &InteractiveWindow::emitWebEvent, Qt::QueuedConnection); - QObject::connect(this, &InteractiveWindow::scriptEventReceived, - _interactiveWindowProxy.get(), &InteractiveWindowProxy::emitScriptEvent, Qt::QueuedConnection); + if (!_interactiveWindowProxy) { + _interactiveWindowProxy = new InteractiveWindowProxy(); + QObject::connect(_interactiveWindowProxy, &InteractiveWindowProxy::webEventReceived, this, &InteractiveWindow::emitWebEvent, Qt::QueuedConnection); + QObject::connect(this, &InteractiveWindow::scriptEventReceived, _interactiveWindowProxy, &InteractiveWindowProxy::emitScriptEvent, Qt::QueuedConnection); + } if (properties.contains(DOCKED_PROPERTY) && presentationMode == InteractiveWindowPresentationMode::Native) { QVariantMap nativeWindowInfo = properties[DOCKED_PROPERTY].toMap(); diff --git a/interface/src/ui/InteractiveWindow.h b/interface/src/ui/InteractiveWindow.h index 57025140a2..a1eede8b8a 100644 --- a/interface/src/ui/InteractiveWindow.h +++ b/interface/src/ui/InteractiveWindow.h @@ -325,7 +325,7 @@ protected slots: private: std::shared_ptr _qmlWindowProxy; std::shared_ptr _dockWidget { nullptr }; - std::unique_ptr _interactiveWindowProxy{ nullptr }; + InteractiveWindowProxy *_interactiveWindowProxy{ nullptr }; }; typedef InteractiveWindow* InteractiveWindowPointer;