From 6372f51bda48ae999bbe9dbc2a14ec9436538ce4 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 29 Apr 2021 01:31:09 -0700 Subject: [PATCH] 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. --- UI/window-basic-main.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index cb65c8402..18009a41f 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -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); }