Projects
Extra
vlc-beta
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 27
View file
_service:obs_scm:vlc-beta-20240906.a52a78e6cd.obscpio/modules/gui/qt/maininterface/compositor_dcomp.cpp -> _service:obs_scm:vlc-beta-20240906.1b69314318.obscpio/modules/gui/qt/maininterface/compositor_dcomp.cpp
Changed
@@ -138,6 +138,27 @@ return false; } + const QString& sceneGraphBackend = qEnvironmentVariable("QT_QUICK_BACKEND"); + if (!sceneGraphBackend.isEmpty() /* if empty, RHI is used */ && + sceneGraphBackend != QLatin1String("rhi")) + { + // No RHI means no D3D11 or D3D12, the graphics API check + // below is only relevant when RHI is in use. + // If QT_QUICK_BACKEND is set to software or openvg, then + // `QQuickWindow::graphicsApi()` might still report D3D11 or + // D3D12 until the scene graph is initialized. + // Unlike `QQuickWindow::graphicsApi()`, `sceneGraphBackend()` + // is only valid after the window is constructed, so instead + // of using `QQuickWindow::sceneGraphBackend()`, simply probe + // the environment variable. + return false; + } + + const auto graphicsApi = QQuickWindow::graphicsApi(); + if (graphicsApi != QSGRendererInterface::Direct3D11 && + graphicsApi != QSGRendererInterface::Direct3D12) + return false; + return true; } @@ -225,53 +246,22 @@ bool appropriateGraphicsApi = true; - QEventLoop eventLoop; connect(quickViewPtr, - &QQuickWindow::sceneGraphInitialized, - &eventLoop, - &eventLoop, &appropriateGraphicsApi, quickViewPtr, this() { - if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11 || - QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D12) - { - connect(quickViewPtr, - &QQuickWindow::frameSwapped, // At this stage, we can be sure that QRhi and QRhiSwapChain are valid. - this, - this, &eventLoop() { - setup(); - eventLoop.quit(); - }, - Qt::SingleShotConnection); - } - else - { - appropriateGraphicsApi = false; - eventLoop.quit(); - } - }, static_cast<Qt::ConnectionType>(Qt::SingleShotConnection | Qt::DirectConnection)); - - connect(quickViewPtr, - &QQuickWindow::sceneGraphError, - &eventLoop, - &eventLoop, &appropriateGraphicsApi(QQuickWindow::SceneGraphError error, const QString &message) { - qWarning() << "CompositorDComp: Scene Graph Error: " << error << ", Message: " << message; - appropriateGraphicsApi = false; - eventLoop.quit(); - }, static_cast<Qt::ConnectionType>(Qt::SingleShotConnection | Qt::DirectConnection)); - - CompositorVideo::Flags flags = CompositorVideo::CAN_SHOW_PIP | CompositorVideo::HAS_ACRYLIC; + &QQuickWindow::frameSwapped, // At this stage, we can be sure that QRhi and QRhiSwapChain are valid. + this, + &CompositorDirectComposition::setup, + Qt::SingleShotConnection); m_quickView->create(); - const bool ret = commonGUICreate(quickViewPtr, quickViewPtr, flags); + const bool ret = commonGUICreate(quickViewPtr, quickViewPtr, CompositorVideo::CAN_SHOW_PIP | CompositorVideo::HAS_ACRYLIC); - if (ret) - m_quickView->show(); - else + if (!ret) return false; - if (!m_quickView->isSceneGraphInitialized()) - eventLoop.exec(); - return (ret && appropriateGraphicsApi); + m_quickView->show(); + + return true; } void CompositorDirectComposition::onSurfacePositionChanged(const QPointF& position)
View file
_service:obs_scm:vlc-beta-20240906.a52a78e6cd.obscpio/modules/gui/qt/maininterface/compositor_platform.cpp -> _service:obs_scm:vlc-beta-20240906.1b69314318.obscpio/modules/gui/qt/maininterface/compositor_platform.cpp
Changed
@@ -95,6 +95,8 @@ m_quickWindow->setOpacity(0.0); m_quickWindow->setOpacity(1.0); + m_rootWindow->installEventFilter(this); + m_rootWindow->show(); m_videoWindow->show(); m_quickWindow->show(); @@ -153,6 +155,28 @@ return m_quickWindow->activeFocusItem(); } +bool CompositorPlatform::eventFilter(QObject *watched, QEvent *event) +{ + // Forward drag events to the child quick window, + // as it is not done automatically by Qt with + // nested windows: + if (m_quickWindow && watched == m_rootWindow.get()) + { + switch (event->type()) { + case QEvent::DragEnter: + case QEvent::DragLeave: + case QEvent::DragMove: + case QEvent::DragResponse: + case QEvent::Drop: + QApplication::sendEvent(m_quickWindow, event); + return true; + default: + break; + }; + } + return false; +} + int CompositorPlatform::windowEnable(const vlc_window_cfg_t *) { commonWindowEnable();
View file
_service:obs_scm:vlc-beta-20240906.a52a78e6cd.obscpio/modules/gui/qt/maininterface/compositor_platform.hpp -> _service:obs_scm:vlc-beta-20240906.1b69314318.obscpio/modules/gui/qt/maininterface/compositor_platform.hpp
Changed
@@ -46,6 +46,8 @@ Type type() const override; QQuickItem * activeFocusItem() const override; + bool eventFilter(QObject *watched, QEvent *event) override; + private: int windowEnable(const vlc_window_cfg_t *) override; void windowDisable() override;
View file
_service:obs_scm:vlc-beta.obsinfo
Changed
@@ -1,4 +1,4 @@ name: vlc-beta -version: 20240906.a52a78e6cd -mtime: 1725645638 -commit: a52a78e6cd05217939e29abbc6ba88b73891f3ff +version: 20240906.1b69314318 +mtime: 1725652245 +commit: 1b693143180a914ba54b4a87fbe1739e31e13fd1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.