Merge pull request #3314 from aws-lumberyard-dev/Atom/guthadam/atomtools_fix_multiple_app_instances

AtomTools: fix multiple material editor processes launching
This commit is contained in:
Guthrie Adams
2021-08-19 16:27:31 -05:00
committed by GitHub
4 changed files with 43 additions and 60 deletions
@@ -28,6 +28,12 @@ int main(int argc, char** argv)
AzQtComponents::AzQtApplication::InitializeDpiScaling();
ShaderManagementConsole::ShaderManagementConsoleApplication app(&argc, &argv);
if (!app.LaunchLocalServer())
{
return 0;
}
app.installEventFilter(new AzQtComponents::GlobalEventFilter(&app));
AZ::IO::FixedMaxPath engineRootPath;
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
@@ -35,13 +41,10 @@ int main(int argc, char** argv)
settingsRegistry->Get(engineRootPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder);
}
auto globalEventFilter = new AzQtComponents::GlobalEventFilter(&app);
app.installEventFilter(globalEventFilter);
AzQtComponents::StyleManager styleManager(&app);
styleManager.initialize(&app, engineRootPath);
app.Start({});
app.Start(AZ::ComponentApplication::Descriptor{});
app.exec();
app.Stop();
return 0;