Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b01a8797 by Fatih Uzunoglu at 2024-11-23T13:51:07+00:00
qt: terminate the application on scene graph error in 
CompositorDirectComposition

When scene graph encounters an error, we are already past the latest stage where
recovery is possible. The interface remains nonfunctional in this case, thus the
application must be terminated. This is already done by Qt itself when the 
signal
is not connected, but in this case we connect to the signal to let the waiting
video thread continue and to print the error.

Note that "If a signal is connected to several slots, the slots are 
activated in
the same order in which the connections were made". So, in this case exit 
is going
to be called after the error is printed, which is the intended behavior.

- - - - -


1 changed file:

- modules/gui/qt/maininterface/compositor_dcomp.cpp


Changes:

=====================================
modules/gui/qt/maininterface/compositor_dcomp.cpp
=====================================
@@ -274,8 +274,19 @@ bool 
CompositorDirectComposition::makeMainInterface(MainCtx* mainCtx)
                 m_setupStateCond.notify_all();
             }, static_cast<Qt::ConnectionType>(Qt::SingleShotConnection | 
Qt::DirectConnection));
 
-    m_quickView->show();
+    // Qt "terminates the application" by default if there is no connection 
made to the signal
+    // QQuickWindow::sceneGraphError(). We need to do the same, because by the 
time the error
+    // is reported, it will likely be too late (`makeMainInterface()` already 
returned true,
+    // which is the latest point recovery is still possible) to recover from 
that error and
+    // the interface will remain unfunctional. It was proposed to wait here 
until the scene
+    // graph is done, but that was not changed in order not to slow down the 
application
+    // start up.
+    connect(quickViewPtr,
+            &QQuickWindow::sceneGraphError,
+            m_mainCtx,
+            &MainCtx::askToQuit);
 
+    m_quickView->show();
     return true;
 }
 



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/b01a87977a62053928a8010eed1034e23fa4a357

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/b01a87977a62053928a8010eed1034e23fa4a357
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to