double shortcuts re-fixed, previous fix caused even dispatching troubles

This commit is contained in:
Kirill Kalishev
2010-03-07 11:41:57 +03:00
parent 78c19a4ad3
commit e3cd2467fb
4 changed files with 17 additions and 7 deletions
@@ -742,7 +742,7 @@ public class IdeEventQueue extends EventQueue {
return peekEvent(FocusEvent.FOCUS_GAINED) != null || peekEvent(FocusEvent.FOCUS_LOST) != null;
}
public boolean isReady() {
private boolean isReady() {
return !myKeyboardBusy && myKeyEventDispatcher.isReady();
}
@@ -291,7 +291,10 @@ public final class IdeKeyEventDispatcher implements Disposable {
myFirstKeyStroke=null;
setState(KeyState.STATE_INIT);
Project project = PlatformDataKeys.PROJECT.getData(myContext.getDataContext());
WindowManager.getInstance().getStatusBar(project).setInfo(null);
StatusBar bar = WindowManager.getInstance().getStatusBar(project);
if (bar != null) {
bar.setInfo(null);
}
return false;
}
@@ -309,7 +312,9 @@ public final class IdeKeyEventDispatcher implements Disposable {
Project project = PlatformDataKeys.PROJECT.getData(myContext.getDataContext());
StatusBarEx statusBar = (StatusBarEx) WindowManager.getInstance().getStatusBar(project);
if (processAction(e, myActionProcessor)) {
statusBar.setInfo(null);
if (statusBar != null) {
statusBar.setInfo(null);
}
return true;
} else {
return false;
@@ -413,7 +418,10 @@ public final class IdeKeyEventDispatcher implements Disposable {
message.append(")");
}
WindowManager.getInstance().getStatusBar(project).setInfo(message.toString());
StatusBar bar = WindowManager.getInstance().getStatusBar(project);
if (bar != null) {
bar.setInfo(message.toString());
}
mySecondStrokeTimeout.cancelAllRequests();
mySecondStrokeTimeout.addRequest(mySecondStrokeTimeoutRunnable, Registry.intValue("actionSystem.secondKeystrokeTimout"));
@@ -72,7 +72,7 @@ public class FocusManagerImpl extends IdeFocusManager implements Disposable {
private final Set<Runnable> myIdleRequests = new com.intellij.util.containers.HashSet<Runnable>();
private final EdtRunnable myIdleRunnable = new EdtRunnable() {
public void runEdt() {
if (isFocusTransferReady() && !isIdleQueueEmpty() && IdeEventQueue.getInstance().isReady()) {
if (isFocusTransferReady() && !isIdleQueueEmpty()) {
flushIdleRequests();
}
else {
@@ -348,7 +348,9 @@ public class FocusManagerImpl extends IdeFocusManager implements Disposable {
myFlushingIdleRequestsEntryCount++;
final KeyEvent[] events = myToDispatchOnDone.toArray(new KeyEvent[myToDispatchOnDone.size()]);
IdeEventQueue.getInstance().getKeyEventDispatcher().resetState();
if (events.length > 0) {
IdeEventQueue.getInstance().getKeyEventDispatcher().resetState();
}
boolean keyWasPressed = false;
@@ -2,7 +2,7 @@ fileIndex.background=false
fileIndex.background.description=Build/update file indices in background
fileIndex.background.restartRequired=true
actionSystem.fixLostTyping=false
actionSystem.fixLostTyping=true
actionSystem.fixLostTyping.description=Redispatch events, lost between actions and dialog show/close
actionSystem.fixStickyFocusedWindows=true
actionSystem.fixNullFocusedComponent=true