mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-124073 (avoid requesting focus manager until app is loaded)
This commit is contained in:
@@ -20,6 +20,7 @@ import com.intellij.ide.dnd.DnDManager;
|
||||
import com.intellij.ide.dnd.DnDManagerImpl;
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.idea.IdeaApplication;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -95,9 +96,8 @@ public class IdeEventQueue extends EventQueue {
|
||||
/**
|
||||
* We exit from suspend mode when focus owner changes and no more WindowEvent.WINDOW_OPENED events
|
||||
* <p/>
|
||||
* in the queue. If WINDOW_OPENED event does exists in the queus then we restart the alarm.
|
||||
* in the queue. If WINDOW_OPENED event does exists in the queues then we restart the alarm.
|
||||
*/
|
||||
|
||||
private Component myFocusOwner;
|
||||
|
||||
private final Runnable myExitSuspendModeRunnable = new ExitSuspendModeRunnable();
|
||||
@@ -718,7 +718,7 @@ public class IdeEventQueue extends EventQueue {
|
||||
}
|
||||
|
||||
private static boolean typeAheadDispatchToFocusManager(AWTEvent e) {
|
||||
if (e instanceof KeyEvent) {
|
||||
if (e instanceof KeyEvent && appIsLoaded()) {
|
||||
final KeyEvent event = (KeyEvent)e;
|
||||
if (!event.isConsumed()) {
|
||||
final IdeFocusManager focusManager = IdeFocusManager.findInstanceByComponent(event.getComponent());
|
||||
@@ -729,6 +729,14 @@ public class IdeEventQueue extends EventQueue {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean ourAppIsLoaded = false;
|
||||
|
||||
private static boolean appIsLoaded() {
|
||||
if (ourAppIsLoaded) return true;
|
||||
boolean loaded = IdeaApplication.isLoaded();
|
||||
if (loaded) ourAppIsLoaded = true;
|
||||
return loaded;
|
||||
}
|
||||
|
||||
public void flushQueue() {
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user