[vlc-commits] [Git][videolan/vlc][master] 4 commits: qt: respect `commonGUICreate()` return value in `CompositorX11::makeMainInterface()`

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Apr 20 10:14:32 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
6c29430c by Fatih Uzunoglu at 2024-04-20T09:31:36+00:00
qt: respect `commonGUICreate()` return value in `CompositorX11::makeMainInterface()`

- - - - -
603074f8 by Fatih Uzunoglu at 2024-04-20T09:31:36+00:00
qt: respect `commonGUICreate()` return value in `CompositorWin7::makeMainInterface()`

- - - - -
b6cab182 by Fatih Uzunoglu at 2024-04-20T09:31:36+00:00
qt: respect `commonGUICreate()` return value in `CompositorDummy::makeMainInterface()`

- - - - -
2a58b2bf by Fatih Uzunoglu at 2024-04-20T09:31:36+00:00
qt: import all used qml modules in MainInterface.qml

Although Qt interface fails gracefully if
MainInterface.qml does not load properly,
The said file does not import all necessary
QML modules that are used throughout the
interface. Once QML engine encounters
an unknown module, the whole interface
becomes no longer usable as it asserts
all required modules to be present.

- - - - -


4 changed files:

- modules/gui/qt/maininterface/compositor_dummy.cpp
- modules/gui/qt/maininterface/compositor_win7.cpp
- modules/gui/qt/maininterface/compositor_x11.cpp
- modules/gui/qt/maininterface/qml/MainInterface.qml


Changes:

=====================================
modules/gui/qt/maininterface/compositor_dummy.cpp
=====================================
@@ -60,6 +60,9 @@ bool CompositorDummy::makeMainInterface(MainCtx* mainCtx)
     ui->setup(m_qmlWidget->engine());
     m_qmlWidget->setContent(QUrl(), ui->getComponent(), ui->createRootItem());
 
+    if (m_qmlWidget->status() != QQuickView::Ready)
+        return false;
+
     m_qmlWidget->show();
 
     return true;


=====================================
modules/gui/qt/maininterface/compositor_win7.cpp
=====================================
@@ -110,9 +110,7 @@ bool CompositorWin7::makeMainInterface(MainCtx* mainCtx)
 
     m_qmlWindowHWND = (HWND)m_qmlView->winId();
 
-    commonGUICreate(m_qmlView.get(), m_qmlView.get(), CompositorVideo::CAN_SHOW_PIP);
-
-    return true;
+    return commonGUICreate(m_qmlView.get(), m_qmlView.get(), CompositorVideo::CAN_SHOW_PIP);
 }
 
 void CompositorWin7::destroyMainInterface()


=====================================
modules/gui/qt/maininterface/compositor_x11.cpp
=====================================
@@ -212,7 +212,8 @@ bool CompositorX11::makeMainInterface(MainCtx* mainCtx)
         flags |= CompositorVideo::HAS_ACRYLIC;
     if (m_renderWindow->supportExtendedFrame())
         flags |= CompositorVideo::HAS_EXTENDED_FRAME;
-    commonGUICreate(m_renderWindow.get(), m_qmlView.get(), flags);
+    if (!commonGUICreate(m_renderWindow.get(), m_qmlView.get(), flags))
+        return false;
 
     m_renderWindow->setInterfaceWindow(m_qmlView.get());
     m_renderWindow->setVideoWindow(m_videoWidget->windowHandle());


=====================================
modules/gui/qt/maininterface/qml/MainInterface.qml
=====================================
@@ -16,8 +16,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+// NOTE: All imports used throughout the interface
+//       must be imported here as well:
+import QtQml
+import QtQml.Models
 import QtQuick
 import QtQuick.Layouts
+import QtQuick.Templates
 import QtQuick.Controls
 import QtQuick.Window
 import Qt5Compat.GraphicalEffects



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c511d743e201a09d567226d1375e90badfd80102...2a58b2bf9263b33538bca88ab4e5e6a04e73c88e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c511d743e201a09d567226d1375e90badfd80102...2a58b2bf9263b33538bca88ab4e5e6a04e73c88e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list