From d9767c34a2e18738b7f7acdcacda58bb88ea1515 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov <654232+AlexeyTsvetkov@users.noreply.github.com> Date: Wed, 2 Aug 2023 20:39:10 +0200 Subject: [PATCH] Set icon on EDT (#3452) --- .../compose/desktop/ide/preview/PreviewToolWindow.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewToolWindow.kt b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewToolWindow.kt index dc1546e0d6..c3a10cd449 100644 --- a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewToolWindow.kt +++ b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewToolWindow.kt @@ -4,6 +4,7 @@ */ package org.jetbrains.compose.desktop.ide.preview +import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.service import com.intellij.openapi.project.DumbAware import com.intellij.openapi.project.Project @@ -18,7 +19,9 @@ class PreviewToolWindow : ToolWindowFactory, DumbAware { isPreviewCompatible(project) override fun init(toolWindow: ToolWindow) { - toolWindow.setIcon(PreviewIcons.COMPOSE) + ApplicationManager.getApplication().invokeLater { + toolWindow.setIcon(PreviewIcons.COMPOSE) + } } override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {