From f91c116e4cb67e419e539b49375909da31bcd207 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 16 Oct 2019 17:16:00 +0200 Subject: [PATCH] IDEA-224868 forbid using of OSProcessHandler before CONFIGURATION_STORE_INITIALIZED - move init of TouchBarsManager after service registration GitOrigin-RevId: 64196687f986fa569cb7b6e944f4da9c500576f8 --- .../src/com/intellij/idea/ApplicationLoader.kt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/idea/ApplicationLoader.kt b/platform/platform-impl/src/com/intellij/idea/ApplicationLoader.kt index 30ab0cb4db75..adb80c721f3a 100644 --- a/platform/platform-impl/src/com/intellij/idea/ApplicationLoader.kt +++ b/platform/platform-impl/src/com/intellij/idea/ApplicationLoader.kt @@ -159,14 +159,21 @@ private fun startApp(app: ApplicationImpl, MacOSApplicationProvider.initApplication() } - // ensure that TouchBarsManager is loaded before WelcomeFrame/project - // do not wait completion - it is thread safe and not required for application start - NonUrgentExecutor.getInstance().execute { + registerFuture.thenRunAsync(Runnable { + // ensure that TouchBarsManager is loaded before WelcomeFrame/project + // do not wait completion - it is thread safe and not required for application start runActivity("mac touchbar") { + if (app.isDisposeInProgress) { + return@Runnable + } Foundation.init() + + if (!app.isDisposeInProgress) { + return@Runnable + } TouchBarsManager.initialize() } - } + }, NonUrgentExecutor.getInstance()) } WeakFocusStackManager.getInstance()