From f0e6bec72aa406194c41b6dc809216a85f7dd2d6 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 11 Aug 2011 19:38:16 +0400 Subject: [PATCH] background update: seldom update; stop when popup is disposed --- .../codeInsight/navigation/BackgroundUpdaterTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java index 43ea9add60b6..af07eef891b8 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java @@ -20,6 +20,8 @@ import com.intellij.openapi.progress.PerformInBackgroundOption; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.Task; import com.intellij.openapi.project.Project; +import com.intellij.openapi.ui.popup.JBPopupAdapter; +import com.intellij.openapi.ui.popup.LightweightWindowEvent; import com.intellij.psi.PsiElement; import com.intellij.ui.popup.AbstractPopup; import com.intellij.util.Alarm; @@ -85,6 +87,7 @@ public abstract class BackgroundUpdaterTask extends Task.Backgroundable { public void run() { myAlarm.cancelAllRequests(); if (myCanceled) return; + if (myPopup.isDisposed()) return; ArrayList data = new ArrayList(); synchronized (lock) { if (comparator != null) { @@ -96,7 +99,7 @@ public abstract class BackgroundUpdaterTask extends Task.Backgroundable { myPopup.setCaption(getCaption(getCurrentSize())); myPopup.pack(true, true); } - }, 10, ModalityState.stateForComponent(myPopup.getContent())); + }, 200, ModalityState.stateForComponent(myPopup.getContent())); } public int getCurrentSize() {