diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/Utils.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/Utils.java index a94e92772bc1..136a626f1fa1 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/Utils.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/Utils.java @@ -187,6 +187,8 @@ public final class Utils { @NotNull ActionGroup group, boolean hideDisabled, @Nullable Consumer missedKeys) { + int maxTime = Registry.intValue("actionSystem.update.actions.async.fast.timeout.ms", 20); + if (maxTime < 1) return null; BlockingQueue queue = new LinkedBlockingQueue<>(); ActionUpdater fastUpdater = ActionUpdater.getActionUpdater(updater.asFastUpdateSession(missedKeys, queue::offer)); try (AccessToken ignore = SlowOperations.allowSlowOperations(SlowOperations.FAST_TRACK)) { @@ -197,7 +199,7 @@ public final class Utils { Runnable runnable = queue.poll(1, TimeUnit.MILLISECONDS); if (runnable != null) runnable.run(); long elapsed = System.currentTimeMillis() - start; - if (elapsed > 10) { + if (elapsed > maxTime) { promise.cancel(); } }); diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 8ce359e8cf5f..c626c6d40239 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -37,6 +37,9 @@ actionSystem.update.actions.async=true actionSystem.update.actions.async.description=Whether to "update" actions on background thread where possible actionSystem.update.actions.async.ui=true actionSystem.update.actions.async.ui.description=Whether to pump EDT events during actions "update" +actionSystem.update.actions.async.fast.timeout.ms=20 +actionSystem.update.actions.async.fast.timeout.ms.description=A timeout in milliseconds for EDT to wait for actions to update using the fast-track. \ + On the fast-track actions are still updated in background but without any slow processing. actionSystem.update.actions.async.test.delay=0 actionSystem.update.actions.async.test.delay.description=An artificial delay in milliseconds to simulate slow actions in menus, popups, and toolbars actionSystem.update.touchbar.actions.use.cached=false @@ -48,7 +51,7 @@ actionSystem.win.suppressAlt.new=true actionSystem.win.suppressAlt.new.description=Enables another approach to consume Alt which may move focus to main menu (Windows L&F only). actionSystem.update.timeout.ms=10000 -actionSystem.update.timeout.ms.description=Timeout in milliseconds for spending on waiting for actions' "update" on UI thread +actionSystem.update.timeout.ms.description=Timeout in milliseconds for spending on waiting for actions' "update" on UI thread actionSystem.toolbar.show.group.in.popup=true actionSystem.toolbar.show.group.in.popup.description=When set to TRUE action groups are shown in popups. When set to FALSE action popup menu is used to show groups