fix: Workspaces not always loading layout correctly

This commit is contained in:
WerWolv
2023-12-12 00:16:21 +01:00
parent 690b0df932
commit 1b457dae7d
6 changed files with 32 additions and 33 deletions

View File

@@ -528,11 +528,6 @@ namespace hex::plugin::builtin {
}
});
EventProviderCreated::subscribe([](auto) {
if (!isAnyViewOpen())
loadDefaultLayout();
});
EventWindowInitialized::subscribe([] {
// Documentation of the value above the setting definition
auto allowServerContact = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.server_contact", 2);

View File

@@ -1,8 +1,8 @@
#include <hex/api/content_registry.hpp>
#include <hex/api/task_manager.hpp>
#include <hex/api/workspace_manager.hpp>
#include <hex/helpers/fs.hpp>
#include <wolv/utils/guards.hpp>
namespace hex::plugin::builtin {
@@ -21,7 +21,10 @@ namespace hex::plugin::builtin {
}
std::string currentWorkspace = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.curr_workspace", "Default");
WorkspaceManager::switchWorkspace(currentWorkspace);
TaskManager::doLater([currentWorkspace] {
WorkspaceManager::switchWorkspace(currentWorkspace);
});
}
}