From aeca2231a597844eeb297b15e4bc9dd066eb2f47 Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 27 Nov 2012 15:23:24 +0100 Subject: [PATCH] backgroundable process without project lead to lost key events (IDEA-95754) == the status bar is chosen randomly; for welcome screen simple NPE workaround (cherry picked from commit e17cc7f763866bb566619fc98d47909d9ef4aebe) --- .../progress/impl/BackgroundableProcessIndicator.java | 6 ++++-- .../lang/ant/config/execution/ExecutionHandler.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java b/platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java index 74da270af886..30ddb76d1f5f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java +++ b/platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java @@ -66,7 +66,7 @@ public class BackgroundableProcessIndicator extends ProgressWindow { } public BackgroundableProcessIndicator(@Nullable final Project project, @NotNull TaskInfo info, @NotNull PerformInBackgroundOption option) { - super(info.isCancellable(), project != null && !project.isDefault(), project, info.getCancelText()); + super(info.isCancellable(), true, project, info.getCancelText()); if (project != null) { final ProjectManagerAdapter myListener = new ProjectManagerAdapter() { public void projectClosing(Project closingProject) { @@ -153,7 +153,9 @@ public class BackgroundableProcessIndicator extends ProgressWindow { } private void doBackground() { - myStatusBar.addProgress(this, myInfo); + if (myStatusBar != null) { //not welcome screen + myStatusBar.addProgress(this, myInfo); + } } public void dispose() { diff --git a/plugins/ant/src/com/intellij/lang/ant/config/execution/ExecutionHandler.java b/plugins/ant/src/com/intellij/lang/ant/config/execution/ExecutionHandler.java index 77e160881c88..db49d467049c 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/execution/ExecutionHandler.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/execution/ExecutionHandler.java @@ -109,7 +109,7 @@ public final class ExecutionHandler { final boolean startInBackground = buildFile.isRunInBackground(); - new Task.Backgroundable(null, AntBundle.message("ant.build.progress.dialog.title"), true) { + new Task.Backgroundable(buildFile.getProject(), AntBundle.message("ant.build.progress.dialog.title"), true) { public boolean shouldStartInBackground() { return startInBackground;