IJPL-149878 IJent WSL FS: show VM options dialogs at most once

GitOrigin-RevId: 5afb5390988dc91962ff39247332a1a30541ccd6
This commit is contained in:
Vladimir Lagunov
2024-06-27 14:44:29 +02:00
committed by intellij-monorepo-bot
parent 98845870c6
commit 941ea922df

View File

@@ -23,6 +23,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.jetbrains.annotations.VisibleForTesting
import java.io.IOException
import java.util.concurrent.atomic.AtomicBoolean
import kotlin.concurrent.thread
@VisibleForTesting
@@ -133,10 +134,15 @@ object IjentWslNioFsVmOptionsSetter {
internal class ApplicationListener : ApplicationActivationListener {
@Service
private class ServiceScope(coroutineScope: CoroutineScope) : CoroutineScope by coroutineScope
private class ServiceScope(coroutineScope: CoroutineScope) : CoroutineScope by coroutineScope {
val dialogMessageHasBeenShown = AtomicBoolean(false)
}
override fun applicationActivated(ideFrame: IdeFrame) {
service<ServiceScope>().launch {
val serviceScope = service<ServiceScope>()
if (serviceScope.dialogMessageHasBeenShown.getAndSet(true)) return
serviceScope.launch {
val changedOptions = ensureInVmOptions()
when {
changedOptions.isEmpty() -> {