mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
close all tooltips for the project when it closes, avoid tooltips leaks
This commit is contained in:
+11
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.notification.impl;
|
||||
|
||||
import com.intellij.codeInsight.hint.TooltipController;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.FrameStateManager;
|
||||
import com.intellij.ide.ui.laf.darcula.ui.DarculaButtonPainter;
|
||||
@@ -30,6 +31,7 @@ import com.intellij.openapi.application.ex.ApplicationEx;
|
||||
import com.intellij.openapi.project.DumbAwareRunnable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.project.ProjectManagerAdapter;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.openapi.ui.DialogWrapperDialog;
|
||||
import com.intellij.openapi.ui.MessageType;
|
||||
@@ -88,6 +90,15 @@ public class NotificationsManagerImpl extends NotificationsManager {
|
||||
|
||||
public NotificationsManagerImpl() {
|
||||
ApplicationManager.getApplication().getMessageBus().connect().subscribe(Notifications.TOPIC, new MyNotificationListener(null));
|
||||
ApplicationManager.getApplication().getMessageBus().connect().subscribe(ProjectManager.TOPIC, new ProjectManagerAdapter() {
|
||||
@Override
|
||||
public void projectClosed(Project project) {
|
||||
for (Notification notification : getNotificationsOfType(Notification.class, project)) {
|
||||
notification.hideBalloon();
|
||||
}
|
||||
TooltipController.getInstance().resetCurrent();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user