IDEA-144156 Goto Class popup isn't closed on click on an editor tab title

This commit is contained in:
Denis Fokin
2015-09-29 15:06:56 +04:00
parent 9761255e76
commit de20f3bf98
2 changed files with 2 additions and 27 deletions
@@ -540,15 +540,7 @@ public abstract class ChooseByNameBase {
return; // Allow toolwindows to gain focus (used by QuickDoc shown in a toolwindow)
}
EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
if (queue instanceof IdeEventQueue) {
if (((IdeEventQueue)queue).wasRootRecentlyClicked(oppositeComponent)) {
Component root = SwingUtilities.getRoot(myTextField);
if (root == null || root.isShowing()) {
hideHint();
}
}
}
hideHint();
}
}
}, 5);
@@ -53,6 +53,7 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.plaf.basic.ComboPopup;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.beans.PropertyChangeEvent;
@@ -636,11 +637,6 @@ public class IdeEventQueue extends EventQueue {
}
});
}
if (me.getButton() != 0) {
setLastClickEvent(me);
} else if (lastClickEvent != null && Math.abs(System.currentTimeMillis() - lastClickTime) > 200){
setLastClickEvent(null);//Obsolete event
}
if (!myMouseEventDispatcher.dispatchMouseEvent(me)) {
defaultDispatchEvent(e);
}
@@ -684,19 +680,6 @@ public class IdeEventQueue extends EventQueue {
}
}
private MouseEvent lastClickEvent;
private long lastClickTime;
private void setLastClickEvent(@Nullable MouseEvent event) {
lastClickEvent = event;
lastClickTime = System.currentTimeMillis();
}
public boolean wasRootRecentlyClicked(Component component) {
return component != null && lastClickEvent != null && lastClickEvent.getComponent() != null &&
SwingUtilities.getRoot(lastClickEvent.getComponent()) == SwingUtilities.getRoot(component);
}
private static void fixStickyWindow(KeyboardFocusManager mgr, Window wnd, String resetMethod) {
Window showingWindow = wnd;