diff --git a/lib/libimhex/include/hex/api/project_file_manager.hpp b/lib/libimhex/include/hex/api/project_file_manager.hpp index db64a8cba..67e1eeb39 100644 --- a/lib/libimhex/include/hex/api/project_file_manager.hpp +++ b/lib/libimhex/include/hex/api/project_file_manager.hpp @@ -36,6 +36,7 @@ namespace hex { static bool hasPath(); static void clearPath(); static std::fs::path getPath(); + static void setPath(const std::fs::path &path); static void registerHandler(const Handler &handler) { getHandlers().push_back(handler); diff --git a/lib/libimhex/source/api/project_file_manager.cpp b/lib/libimhex/source/api/project_file_manager.cpp index 8f167b7a0..5a73cc3e3 100644 --- a/lib/libimhex/source/api/project_file_manager.cpp +++ b/lib/libimhex/source/api/project_file_manager.cpp @@ -144,9 +144,13 @@ namespace hex { void ProjectFile::clearPath() { ProjectFile::s_currProjectPath.clear(); } - + std::fs::path ProjectFile::getPath() { return ProjectFile::s_currProjectPath; } + void ProjectFile::setPath(const std::fs::path &path) { + ProjectFile::s_currProjectPath = path; + } + } \ No newline at end of file diff --git a/main/source/window/window.cpp b/main/source/window/window.cpp index a740450c6..ccadea55b 100644 --- a/main/source/window/window.cpp +++ b/main/source/window/window.cpp @@ -816,9 +816,6 @@ namespace hex { void Window::exitImGui() { delete static_cast(ImGui::GetIO().UserData); - ImNodes::PopAttributeFlag(); - ImNodes::PopAttributeFlag(); - ImGui::SaveIniSettingsToDisk(hex::toUTF8String(this->m_imguiSettingsPath).c_str()); ImGui_ImplOpenGL3_Shutdown(); diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index 041dc1797..f8e8014e6 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -480,8 +480,15 @@ namespace hex::plugin::builtin { if (!recentFile.isValid()) continue; - if (auto settings = provider->storeSettings(); !settings.is_null()) - recentFile.write(settings.dump(4)); + { + auto path = ProjectFile::getPath(); + ProjectFile::clearPath(); + + if (auto settings = provider->storeSettings(); !settings.is_null()) + recentFile.write(settings.dump(4)); + + ProjectFile::setPath(path); + } } }