fix: Post-pone file opening till everything has been initialized

This commit is contained in:
WerWolv 2025-12-07 14:00:10 +01:00
parent 347fc3ed9f
commit 3f9ce561b9
1 changed files with 21 additions and 19 deletions

View File

@ -40,6 +40,7 @@
namespace hex::plugin::builtin {
static void openFile(const std::fs::path &path) {
TaskManager::doLater([path] {
if (path.extension() == ".hexproj") {
if (!ProjectFile::load(path)) {
ui::ToastError::open(fmt::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
@ -64,6 +65,7 @@ namespace hex::plugin::builtin {
glfwRequestWindowAttention(ImHexApi::System::getMainWindowHandle());
glfwFocusWindow(ImHexApi::System::getMainWindowHandle());
}
});
}
void registerEventHandlers() {