Skip to content

Commit

Permalink
Always reparent start dialog windows on macOS
Browse files Browse the repository at this point in the history
Because not doing so crashes on Qt6. It's the inverse of Linux on Qt6,
which crashes when reparenting instead, which is why this whole
rigmarole was added.
  • Loading branch information
askmeaboutlo0m committed Oct 5, 2024
1 parent 27bec69 commit d0f6e79
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/desktop/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,13 @@ void MainWindow::setStartDialogActions(dialogs::StartDialog *dlg)

void MainWindow::closeStartDialog(dialogs::StartDialog *dlg, bool reparent)
{
// Linux on Qt6 crashes when reparenting children of a dialog that's about
// to close after hosting, so we don't reparent in that case and just close
// the dialog. On the other hand, macOS on Qt6 crashes when closing the
// dialog instead, so we always reparent there.
#ifdef Q_OS_MACOS
reparent = true;
#endif
if(reparent) {
for(QDialog *child : dlg->findChildren<QDialog *>(
QString(), Qt::FindDirectChildrenOnly)) {
Expand Down

0 comments on commit d0f6e79

Please sign in to comment.