mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure smartInvokeLater runnable doesn't get invoked in a wrong modality state
This commit is contained in:
@@ -411,25 +411,16 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica
|
||||
|
||||
@Override
|
||||
public void smartInvokeLater(@NotNull final Runnable runnable) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
runWhenSmart(runnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return runnable.toString();
|
||||
}
|
||||
}, myProject.getDisposed());
|
||||
smartInvokeLater(runnable, ModalityState.defaultModalityState());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void smartInvokeLater(@NotNull final Runnable runnable, @NotNull ModalityState modalityState) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
runWhenSmart(runnable);
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
if (isDumb()) {
|
||||
runWhenSmart(() -> smartInvokeLater(runnable, modalityState));
|
||||
} else {
|
||||
runnable.run();
|
||||
}
|
||||
}, modalityState, myProject.getDisposed());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user