mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-188519 Actions that do not show popup because of dumb mode fail typeahead
This commit is contained in:
@@ -229,6 +229,8 @@ public class IdeEventQueue extends EventQueue {
|
||||
addDispatcher(new EditingCanceller(), null);
|
||||
|
||||
abracadabraDaberBoreh();
|
||||
|
||||
IdeKeyEventDispatcher.addDumbModeWarningListener(() -> flushDelayedKeyEvents());
|
||||
}
|
||||
|
||||
private void abracadabraDaberBoreh() {
|
||||
@@ -1386,7 +1388,7 @@ public class IdeEventQueue extends EventQueue {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void flushDelayedKeyEvents() {
|
||||
public void flushDelayedKeyEvents() {
|
||||
delayKeyEvents.set(false);
|
||||
int size = myDelayedKeyEvents.size();
|
||||
for (int keyEventIndex = 0; keyEventIndex < size; keyEventIndex++) {
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.keymap.impl;
|
||||
|
||||
public interface DumbModeWarningListener {
|
||||
void actionCanceledBecauseOfDumbMode();
|
||||
}
|
||||
+13
@@ -628,6 +628,13 @@ public final class IdeKeyEventDispatcher implements Disposable {
|
||||
}
|
||||
|
||||
if (!nonDumbAwareAction.isEmpty()) {
|
||||
|
||||
if (dumbModeWarningListener != null) {
|
||||
dumbModeWarningListener.actionCanceledBecauseOfDumbMode();
|
||||
}
|
||||
|
||||
IdeEventQueue.getInstance().flushDelayedKeyEvents();
|
||||
|
||||
showDumbModeWarningLaterIfNobodyConsumesEvent(e, nonDumbAwareAction.toArray(new AnActionEvent[0]));
|
||||
}
|
||||
|
||||
@@ -644,6 +651,12 @@ public final class IdeKeyEventDispatcher implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private static DumbModeWarningListener dumbModeWarningListener = null;
|
||||
|
||||
public static void addDumbModeWarningListener (DumbModeWarningListener listener) {
|
||||
dumbModeWarningListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method fills {@code myActions} list.
|
||||
* @return true if there is a shortcut with second stroke found.
|
||||
|
||||
Reference in New Issue
Block a user