diff --git a/src/app/AppController.cpp b/src/app/AppController.cpp index bb9314765..653407fd0 100644 --- a/src/app/AppController.cpp +++ b/src/app/AppController.cpp @@ -50,6 +50,9 @@ AppController::AppController (int &argc, char *argv[]) { QGuiApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true); + // Useful to share camera on Fullscreen (other context). + QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); + // --------------------------------------------------------------------------- // App creation. // --------------------------------------------------------------------------- diff --git a/src/components/camera/Camera.cpp b/src/components/camera/Camera.cpp index be23f6613..df113935e 100644 --- a/src/components/camera/Camera.cpp +++ b/src/components/camera/Camera.cpp @@ -56,12 +56,13 @@ CameraRenderer::~CameraRenderer () { qInfo() << QStringLiteral("Delete context info:") << mContextInfo; CoreManager *coreManager = CoreManager::getInstance(); - coreManager->lockVideoRender(); - if (mIsPreview) - coreManager->getCore()->setNativePreviewWindowId(nullptr); - else if (mCall) + shared_ptr core = coreManager->getCore(); + if (mIsPreview) { + if (core->getNativePreviewWindowId() == mContextInfo) + core->setNativePreviewWindowId(nullptr); + } else if (mCall && mCall->getNativeVideoWindowId() == mContextInfo) mCall->setNativeVideoWindowId(nullptr); coreManager->unlockVideoRender();