mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
platform: add makeCurrentMessageDialogGoAway to the end of event queue
When we show message dialog on mac we use `SheetMessage`, that create dialog in three steps: 1. Create JDialog and calculate components size 2. Start animation calling `startAnimation` 3. When animation is finished set JDialog component to what it should be The problem is: if we call `makeCurrentMessageDialogGoAway` using `UIUtil.invokeLaterIfNeeded` it will be invoked before animation stopped and won't find cancel button, which is the only way to close the dialog. Force add event to the end of queue may fix this problem in some cases.
This commit is contained in:
@@ -177,7 +177,8 @@ public class Messages {
|
||||
@NotNull
|
||||
public static Runnable createMessageDialogRemover(@Nullable Project project) {
|
||||
Window projectWindow = project == null ? null : WindowManager.getInstance().suggestParentWindow(project);
|
||||
return () -> UIUtil.invokeLaterIfNeeded(() -> makeCurrentMessageDialogGoAway(
|
||||
//noinspection SSBasedInspection
|
||||
return () -> SwingUtilities.invokeLater(() -> makeCurrentMessageDialogGoAway(
|
||||
projectWindow != null ? projectWindow.getOwnedWindows() : Window.getWindows()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user