From cadbbd12e26373cbd8153382fc0cc2c9a9dcfeee Mon Sep 17 00:00:00 2001 From: Kirill Kirichenko Date: Wed, 30 Jun 2021 19:16:32 +0300 Subject: [PATCH] IDEA-270766 "Usages of ..." tool window notification is not closed after search is completed GitOrigin-RevId: f62c177a1f1d15caaffdee06c6cda72ead204d86 --- .../com/intellij/usages/impl/SearchForUsagesRunnable.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/usageView/src/com/intellij/usages/impl/SearchForUsagesRunnable.java b/platform/usageView/src/com/intellij/usages/impl/SearchForUsagesRunnable.java index 8f0f1e9e9c8f..b2bbafb5ca10 100644 --- a/platform/usageView/src/com/intellij/usages/impl/SearchForUsagesRunnable.java +++ b/platform/usageView/src/com/intellij/usages/impl/SearchForUsagesRunnable.java @@ -355,12 +355,14 @@ final class SearchForUsagesRunnable implements Runnable { CoreProgressManager.assertUnderProgress(indicator); } TooManyUsagesStatus.createFor(indicator); + AtomicBoolean showBalloon = new AtomicBoolean(true); + EdtScheduledExecutorService.getInstance().schedule(() -> { - if (!myProject.isDisposed()) { + if (!myProject.isDisposed() && showBalloon.get()) { notifyByFindBalloon(null, MessageType.WARNING, Collections.singletonList(StringUtil.escapeXmlEntities(UsageViewManagerImpl.getProgressTitle(myPresentation)))); + findStartedBalloonShown.set(true); } - findStartedBalloonShown.set(true); }, ModalityState.NON_MODAL, 300, TimeUnit.MILLISECONDS); UsageSearcher usageSearcher = mySearcherFactory.create(); long startSearchStamp = System.currentTimeMillis(); @@ -406,6 +408,7 @@ final class SearchForUsagesRunnable implements Runnable { balloon.hide(); } } + showBalloon.set(false); }, myProject.getDisposed()); }