From 8eb7d9779ab4b2233b93e76a115e6420c17ff4e0 Mon Sep 17 00:00:00 2001 From: Tatiana Elfimova Date: Wed, 5 Aug 2026 16:23:06 +0200 Subject: [PATCH] IJPL-248178 Fix the race between two writers of the ATK Wrapper VM option Setting GeneralSettings.isSupportScreenReaders notifies ScreenReaderStateManager, which synchronizes the same VM option from its own coroutine. Both writers raced, and when the listener won, updateAtkWrapperVmOption found the option already up to date and reported that nothing had changed. If the temporary in-session activation of the wrapper had failed as well, applyRequestedChanges then skipped the restart, so the requested configuration only took effect after the next manual restart and the user was not told about it. (cherry picked from commit 9238f77faac6659ba73e97f7bd669c1104f70a38) GitOrigin-RevId: 6acbaccdb10fa4be3ea5771479a3bf1befa4d612 --- .../intellij/accessibility/LinuxAccessibilitySupport.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/accessibility/LinuxAccessibilitySupport.kt b/platform/platform-impl/src/com/intellij/accessibility/LinuxAccessibilitySupport.kt index 4e3c5ab2fa91..d6c7b03a08e6 100644 --- a/platform/platform-impl/src/com/intellij/accessibility/LinuxAccessibilitySupport.kt +++ b/platform/platform-impl/src/com/intellij/accessibility/LinuxAccessibilitySupport.kt @@ -119,14 +119,14 @@ object LinuxAccessibilitySupport { * or to leave the temporary runtime ATK Wrapper activation state. */ suspend fun applyRequestedChanges(): Boolean { - if (screenReaderSupportRequested && !isSupportScreenReadersOverridden()) { - serviceAsync().isSupportScreenReaders = true - } - val vmOptionsUpdated = linuxAccessibilitySupportRequested && !atkWrapperEnabledInConfig && updateAtkWrapperVmOption(shouldEnableAtkWrapper = true) + if (screenReaderSupportRequested && !isSupportScreenReadersOverridden()) { + serviceAsync().isSupportScreenReaders = true + } + val restartRequired = atkWrapperActivatedInCurrentSession || vmOptionsUpdated if (restartRequired) { AccessibilityUsageTrackerCollector.flushRaisedEvents()