mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-42827 postpone displaying ballons until the application is loaded to fix notification-induced cyclic component initialization
This commit is contained in:
+14
@@ -20,6 +20,8 @@ import com.intellij.notification.*;
|
||||
import com.intellij.notification.impl.ui.NotificationsUtil;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
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;
|
||||
@@ -111,6 +113,18 @@ public class NotificationsManagerImpl extends NotificationsManager {
|
||||
}
|
||||
|
||||
private static void showNotification(final Notification notification, @Nullable final Project project) {
|
||||
Application application = ApplicationManager.getApplication();
|
||||
if (application instanceof ApplicationEx && !((ApplicationEx)application).isLoaded()) {
|
||||
application.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showNotification(notification, project);
|
||||
}
|
||||
}, ModalityState.current());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String groupId = notification.getGroupId();
|
||||
final NotificationSettings settings = NotificationsConfigurationImpl.getSettings(groupId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user