From 5c8fdbc73ccd79320104b50cedfb3f711c5fa480 Mon Sep 17 00:00:00 2001 From: Nikolay Chashnikov Date: Fri, 28 Mar 2025 13:07:23 +0100 Subject: [PATCH] [platform] wait until ApplicationInfo is loaded before setting the frame class in XToolkit (IJPL-165691) Otherwise, when an embedded variant of the frontend process (JetBrains Client) is started, it may not load ApplicationInfo, and the frame class won't be set leading to an incorrect icon in the taskbar. Also, if an attempt to set the frame class fails with an exception, a warning should be printed to the log. GitOrigin-RevId: d47ea5ba0d0dd1b14b2a75d278490d4dd6007cce --- .../bootstrap/src/com/intellij/platform/ide/bootstrap/ui.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/ui.kt b/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/ui.kt index f3d117bc6bc8..c921165eb4cf 100644 --- a/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/ui.kt +++ b/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/ui.kt @@ -228,6 +228,7 @@ internal fun CoroutineScope.scheduleUpdateFrameClassAndWindowIconAndPreloadSyste if (StartupUiUtil.isXToolkit()) { launch(CoroutineName("frame class updating")) { + appInfoDeferred.join() try { val toolkit = Toolkit.getDefaultToolkit() val aClass = toolkit.javaClass @@ -237,7 +238,8 @@ internal fun CoroutineScope.scheduleUpdateFrameClassAndWindowIconAndPreloadSyste .invoke(AppUIUtil.getFrameClass()) } } - catch (_: Throwable) { + catch (t: Throwable) { + logger().warn("Failed to set WM frame class in XToolkit: $t") } } }