mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
locator for IdeFocusManager fixed, for semi-initialized application (idea server dialog showing)
This commit is contained in:
@@ -132,9 +132,17 @@ public abstract class IdeFocusManager {
|
||||
|
||||
public abstract Expirable getTimestamp(boolean trackOnlyForcedCommands);
|
||||
|
||||
@NotNull
|
||||
public static IdeFocusManager getGlobalInstance() {
|
||||
Application app = ApplicationManager.getApplication();
|
||||
return app != null ? app.getComponent(IdeFocusManager.class) : PassThroughtIdeFocusManager.getInstance();
|
||||
IdeFocusManager fm = app != null ? app.getComponent(IdeFocusManager.class) : PassThroughtIdeFocusManager.getInstance();
|
||||
|
||||
// It happens when IDEA server dialog is shown, app != null but it's semi-initialized
|
||||
if (fm == null) {
|
||||
fm = PassThroughtIdeFocusManager.getInstance();
|
||||
}
|
||||
|
||||
return fm;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user