Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
f9cb4c0e by Pierre Lamot at 2022-02-04T10:07:46+00:00
qt: fix crash when Modal dialog is created with null parameters

- - - - -
499303f9 by Pierre Lamot at 2022-02-04T10:07:46+00:00
qt: fix window parenting of nested modal dialogs

windowHandle() may return null if the current widget is not the window widget

fix: #26578

- - - - -


5 changed files:

- modules/gui/qt/dialogs/open/open.cpp
- modules/gui/qt/dialogs/plugins/plugins.cpp
- modules/gui/qt/dialogs/sout/profile_selector.cpp
- modules/gui/qt/dialogs/vlm/vlm.cpp
- modules/gui/qt/widgets/native/qvlcframe.cpp


Changes:

=====================================
modules/gui/qt/dialogs/open/open.cpp
=====================================
@@ -277,7 +277,9 @@ void OpenDialog::toggleAdvancedPanel()
 
 void OpenDialog::browseInputSlave()
 {
-    OpenDialog *od = new OpenDialog( windowHandle(), p_intf, true, SELECT );
+    QWidget* windowWidget = window();
+    QWindow* parentWindow = windowWidget ? windowWidget->windowHandle() : 
nullptr;
+    OpenDialog *od = new OpenDialog( parentWindow, p_intf, true, SELECT );
     od->exec();
     ui.slaveText->setText( od->getMRL( false ) );
     delete od;
@@ -408,7 +410,9 @@ void OpenDialog::stream( bool b_transcode_only )
     {
         msg_Dbg( p_intf, "MRL(s) passed to the Sout: %s", qtu( soutMRLS[i] ) );
     }
-    THEDP->streamingDialog( windowHandle(), soutMRLS, b_transcode_only,
+    QWidget* windowWidget = window();
+    QWindow* parentWindow = windowWidget ? windowWidget->windowHandle() : 
nullptr;
+    THEDP->streamingDialog( parentWindow, soutMRLS, b_transcode_only,
                             getOptions().split( " :" ) );
 }
 


=====================================
modules/gui/qt/dialogs/plugins/plugins.cpp
=====================================
@@ -297,7 +297,9 @@ void ExtensionTab::moreInformation()
     if( !index.isValid() )
         return;
 
-    ExtensionInfoDialog dlg( index, p_intf, windowHandle() );
+    QWidget* windowWidget = window();
+    QWindow* parentWindow = windowWidget ? windowWidget->windowHandle() : 
nullptr;
+    ExtensionInfoDialog dlg( index, p_intf, parentWindow );
     dlg.exec();
 }
 
@@ -592,7 +594,9 @@ void AddonsTab::moreInformation()
 {
     QModelIndex index = 
addonsView->selectionModel()->selectedIndexes().first();
     if( !index.isValid() ) return;
-    AddonInfoDialog dlg( index, p_intf, windowHandle() );
+    QWidget* windowWidget = window();
+    QWindow* parentWindow = windowWidget ? windowWidget->windowHandle() : 
nullptr;
+    AddonInfoDialog dlg( index, p_intf, parentWindow );
     dlg.exec();
 }
 


=====================================
modules/gui/qt/dialogs/sout/profile_selector.cpp
=====================================
@@ -142,7 +142,9 @@ void VLCProfileSelector::editProfile()
 void VLCProfileSelector::editProfile( const QString& qs, const QString& value )
 {
     /* Create the Profile Editor */
-    VLCProfileEditor *editor = new VLCProfileEditor( qs, value, windowHandle() 
);
+    QWidget* windowWidget = window();
+    QWindow* parentWindow = windowWidget ? windowWidget->windowHandle() : 
nullptr;
+    VLCProfileEditor *editor = new VLCProfileEditor( qs, value,  parentWindow 
);
 
     /* Show it */
     if( QDialog::Accepted == editor->exec() )


=====================================
modules/gui/qt/dialogs/vlm/vlm.cpp
=====================================
@@ -356,7 +356,9 @@ void VLMDialog::selectInput()
 
 void VLMDialog::selectOutput()
 {
-    SoutDialog *s = new SoutDialog( windowHandle(), p_intf );
+    QWidget* windowWidget = window();
+    QWindow* parentWindow = windowWidget ? windowWidget->windowHandle() : 
nullptr;
+    SoutDialog *s = new SoutDialog( parentWindow, p_intf );
     if( s->exec() == QDialog::Accepted )
     {
         int i = s->getChain().indexOf( " " );


=====================================
modules/gui/qt/widgets/native/qvlcframe.cpp
=====================================
@@ -221,7 +221,7 @@ void QVLCDialog::keyPressEvent(QKeyEvent *keyEvent)
 
 void QVLCDialog::setWindowTransientParent(QWidget* widget, QWindow* parent, 
qt_intf_t* p_intf)
 {
-    if (!parent)
+    if (!parent && p_intf)
         parent = p_intf->p_compositor->interfaceMainWindow();
     if (!parent)
         return;



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/15ec6fd302b7a713206b644832878f99b0572414...499303f97f3cfd2b339fc9207c341a8d76c7bac2

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/15ec6fd302b7a713206b644832878f99b0572414...499303f97f3cfd2b339fc9207c341a8d76c7bac2
You're receiving this email because of your account on code.videolan.org.


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

Reply via email to