double shortcuts re-fixed, previous fix caused even dispatching troubles
authorKirill Kalishev <kirill.kalishev@jetbrains.com>
Sun, 7 Mar 2010 08:41:57 +0000 (11:41 +0300)
committerKirill Kalishev <kirill.kalishev@jetbrains.com>
Sun, 7 Mar 2010 08:41:57 +0000 (11:41 +0300)
platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/FocusManagerImpl.java
platform/platform-resources-en/src/misc/registry.properties

index 18b431ca8c0dadc02b65b4f118d723234d61aa16..1f0b844e5dc11fd1cff7e7275c5dc4a919f9bc5d 100644 (file)
@@ -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();
   }
 
index c4f0098fbd654994216e8f2bddc461d43f0c7810..b16fcdb916dee3ae28ede524b5958ccbc9cb3cd4 100644 (file)
@@ -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"));
index c6c7d5fc746f88e885bc8d71e3f23e64720d91ed..5fc4b609b2e67a6c9696828276ca685cff645a97 100644 (file)
@@ -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;
 
index 7f571bf49a36eb49cca36e3edade6d69ac6dfbf3..3e416e34df5556f663d21922073adc72c19d30bb 100644 (file)
@@ -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