[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
This commit is contained in:
Nikolay Chashnikov
2025-03-28 14:37:17 +00:00
committed by intellij-monorepo-bot
parent 33a8840101
commit 5c8fdbc73c
@@ -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<AppStarter>().warn("Failed to set WM frame class in XToolkit: $t")
}
}
}