diff --git a/loader/src/hooks/MenuLayer.cpp b/loader/src/hooks/MenuLayer.cpp index 665a2490..a7e1652b 100644 --- a/loader/src/hooks/MenuLayer.cpp +++ b/loader/src/hooks/MenuLayer.cpp @@ -103,19 +103,21 @@ struct CustomMenuLayer : Modify { if (!shownTriedToLoadDlls) { shownTriedToLoadDlls = true; if (LoaderImpl::get()->userTriedToLoadDLLs()) { - auto popup = FLAlertLayer::create( - "Hold up!", - "It appears that you have tried to load DLLs with Geode. " - "Please note that Geode is incompatible with ALL DLLs, " - "as they can cause Geode mods to error, or even " - "crash.\n\n" - "Remove the DLLs / other mod loaders you have, or proceed at " - "your own risk.", - "OK" - ); - popup->m_scene = this; - popup->m_noElasticity = true; - popup->show(); + Loader::get()->queueInMainThread([] { + auto popup = FLAlertLayer::create( + "Hold up!", + "It appears that you have tried to load DLLs with Geode. " + "Please note that Geode is incompatible with ALL DLLs, " + "as they can cause Geode mods to error, or even " + "crash.\n\n" + "Remove the DLLs / other mod loaders you have, or proceed at " + "your own risk.", + "OK" + ); + + popup->m_noElasticity = true; + popup->show(); + }); } } @@ -123,15 +125,18 @@ struct CustomMenuLayer : Modify { static bool shownUpdateInfo = false; if (updater::isNewUpdateDownloaded() && !shownUpdateInfo) { shownUpdateInfo = true; - auto popup = FLAlertLayer::create( - "Update downloaded", - "A new update for Geode has been installed! " - "Please restart the game to apply.", - "OK" - ); - popup->m_scene = this; - popup->m_noElasticity = true; - popup->show(); + + Loader::get()->queueInMainThread([] { + auto popup = FLAlertLayer::create( + "Update downloaded", + "A new update for Geode has been installed! " + "Please restart the game to apply.", + "OK" + ); + + popup->m_noElasticity = true; + popup->show(); + }); } // show crash info @@ -142,22 +147,26 @@ struct CustomMenuLayer : Modify { !Mod::get()->template getSettingValue("disable-last-crashed-popup") ) { shownLastCrash = true; - auto popup = createQuickPopup( - "Crashed", - "It appears that the last session crashed. Would you like to " - "open the crashlog folder?", - "No", - "Yes", - [](auto, bool btn2) { - if (btn2) { - file::openFolder(dirs::getCrashlogsDir()); - } - }, - false - ); - popup->m_scene = this; - popup->m_noElasticity = true; - popup->show(); + + // open the dialog a frame later (after the scene is set) for proper key priority + Loader::get()->queueInMainThread([] { + auto popup = createQuickPopup( + "Crashed", + "It appears that the last session crashed. Would you like to " + "open the crashlog folder?", + "No", + "Yes", + [](auto, bool btn2) { + if (btn2) { + file::openFolder(dirs::getCrashlogsDir()); + } + }, + false + ); + popup->m_noElasticity = true; + + popup->show(); + }); } // Check for mod updates