mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
[jewel] IJPL-214573 Main menu button sometimes appears on macOS
GitOrigin-RevId: b33045a9c65dd5b78124d61345d6b3ce2960017a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4acb318ca2
commit
efe4ddbec8
@@ -5,21 +5,32 @@ import com.intellij.ide.ApplicationActivity
|
||||
import com.intellij.openapi.diagnostic.thisLogger
|
||||
import com.intellij.platform.diagnostic.telemetry.Scope
|
||||
import com.intellij.platform.diagnostic.telemetry.TelemetryManager
|
||||
import com.intellij.util.system.OS
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.jetbrains.jewel.bridge.setSkikoLibraryPath
|
||||
import org.jetbrains.jewel.foundation.InternalJewelApi
|
||||
import org.jetbrains.skiko.Library
|
||||
|
||||
// org.jetbrains.skiko.Library.load seems expensive, better have it loaded before the first rendering happens
|
||||
internal class SkikoPreloader : ApplicationActivity {
|
||||
private val SKIKO: Scope = Scope("skiko")
|
||||
|
||||
@OptIn(InternalJewelApi::class)
|
||||
override suspend fun execute() {
|
||||
val tracer = TelemetryManager.getInstance().getSimpleTracer(SKIKO)
|
||||
withContext(tracer.span("org.jetbrains.skiko.Library.load")) {
|
||||
thisLogger().debug("Preloading Skiko")
|
||||
|
||||
setSkikoLibraryPath()
|
||||
setMacMenuBarDefaults()
|
||||
Library.load()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setMacMenuBarDefaults() {
|
||||
if (OS.CURRENT == OS.macOS) {
|
||||
// do not enable the screen menu bar on macOS during setup of Skiko
|
||||
System.setProperty("skiko.rendering.useScreenMenuBar", "false")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user