From d8e7a640fa18ffc3d5715a8504084740a1978f19 Mon Sep 17 00:00:00 2001 From: irengrig Date: Tue, 1 Dec 2009 17:41:21 +0300 Subject: [PATCH] VCS: action queued after local changes refresh should be called on AWT thread by convention (for Changes View refresh in AWT thread) r=Shrago --- .../com/intellij/openapi/vcs/changes/FictiveBackgroundable.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FictiveBackgroundable.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FictiveBackgroundable.java index 92e51f3a77..a8fc15a456 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FictiveBackgroundable.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/FictiveBackgroundable.java @@ -15,6 +15,7 @@ */ package com.intellij.openapi.vcs.changes; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.Task; @@ -25,16 +26,22 @@ import org.jetbrains.annotations.Nullable; class FictiveBackgroundable extends Task.Backgroundable { private final Waiter myWaiter; + private final ModalityState myState; FictiveBackgroundable(@Nullable final Project project, @NotNull final Runnable runnable, final boolean cancellable, final String title, final ModalityState state) { super(project, VcsBundle.message("change.list.manager.wait.lists.synchronization", title), cancellable, BackgroundFromStartOption.getInstance()); + myState = state; myWaiter = new Waiter(project, runnable, state, VcsBundle.message("change.list.manager.wait.lists.synchronization", title), cancellable); } public void run(@NotNull final ProgressIndicator indicator) { myWaiter.run(indicator); - myWaiter.onSuccess(); + ApplicationManager.getApplication().invokeLater(new Runnable() { + public void run() { + myWaiter.onSuccess(); + } + }, myState); } public void done() { -- 2.11.4.GIT