mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-144156 Goto Class popup isn't closed on click on an editor tab title
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user