UI: Fix missing files dialog starting hidden (macOS)

An annoying hack to fix the dialog being hidden behind the main window
when the program starts up on macOS.
This commit is contained in:
jp9000
2021-04-29 01:33:40 -07:00
parent eb4dbb72c7
commit 6372f51bda
+9 -4
View File
@@ -1164,10 +1164,15 @@ retryScene:
LogScenes();
if (obs_missing_files_count(files) > 0) {
missDialog = new OBSMissingFiles(files, this);
missDialog->setAttribute(Qt::WA_DeleteOnClose, true);
missDialog->show();
missDialog->raise();
/* the window hasn't fully initialized by this point on macOS,
* so put this at the end of the current task queue. Fixes a
* bug where the window be behind OBS on startup */
QTimer::singleShot(0, [this, files] {
missDialog = new OBSMissingFiles(files, this);
missDialog->setAttribute(Qt::WA_DeleteOnClose, true);
missDialog->show();
missDialog->raise();
});
} else {
obs_missing_files_destroy(files);
}