mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix corner cases with "not merge" bug
This commit is contained in:
+2
-4
@@ -325,10 +325,8 @@ public class NotificationsManagerImpl extends NotificationsManager {
|
||||
@NotNull Disposable parentDisposable) {
|
||||
final BalloonLayoutData layoutData = layoutDataRef.isNull() ? new BalloonLayoutData() : layoutDataRef.get();
|
||||
if (layoutData.groupId == null) {
|
||||
if (NotificationsConfigurationImpl.getSettings(notification.getGroupId()).isShouldLog()) {
|
||||
layoutData.groupId = notification.getGroupId();
|
||||
layoutData.id = notification.id;
|
||||
}
|
||||
layoutData.groupId = notification.getGroupId();
|
||||
layoutData.id = notification.id;
|
||||
}
|
||||
else {
|
||||
layoutData.groupId = null;
|
||||
|
||||
@@ -134,22 +134,8 @@ public class BalloonLayoutImpl implements BalloonLayout {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
Balloon merge = merge(layoutData);
|
||||
if (merge == null) {
|
||||
if (getVisibleCount() > 0 && layoutData instanceof BalloonLayoutData && ((BalloonLayoutData)layoutData).groupId != null) {
|
||||
int index = -1;
|
||||
int count = 0;
|
||||
for (int i = 0, size = myBalloons.size(); i < size; i++) {
|
||||
BalloonLayoutData ld = myLayoutData.get(myBalloons.get(i));
|
||||
if (ld != null && ld.groupId != null) {
|
||||
if (index == -1) {
|
||||
index = i;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count > 0 && count == getVisibleCount()) {
|
||||
remove(myBalloons.get(index));
|
||||
}
|
||||
if (!myBalloons.isEmpty() && myBalloons.size() == getVisibleCount()) {
|
||||
remove(myBalloons.get(0));
|
||||
}
|
||||
myBalloons.add(balloon);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user