mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-146563 [regression] Middle-click on editor tabs, only closes one editor, the following middle-clicks are not registered
This commit is contained in:
@@ -26,7 +26,6 @@ import com.intellij.openapi.application.ex.ApplicationEx;
|
||||
import com.intellij.openapi.application.impl.LaterInvocator;
|
||||
import com.intellij.openapi.diagnostic.FrequentEventDetector;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.keymap.KeyboardSettingsExternalizable;
|
||||
import com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher;
|
||||
import com.intellij.openapi.keymap.impl.IdeMouseEventDispatcher;
|
||||
import com.intellij.openapi.keymap.impl.KeyState;
|
||||
@@ -61,6 +60,9 @@ import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static java.awt.event.MouseEvent.MOUSE_MOVED;
|
||||
import static java.awt.event.MouseEvent.MOUSE_PRESSED;
|
||||
|
||||
/**
|
||||
* @author Vladimir Kondratyev
|
||||
* @author Anton Katilin
|
||||
@@ -635,6 +637,12 @@ public class IdeEventQueue extends EventQueue {
|
||||
}
|
||||
else if (e instanceof MouseEvent) {
|
||||
MouseEvent me = (MouseEvent)e;
|
||||
if (me.getID() == MOUSE_PRESSED && me.getModifiers() > 0 && me.getModifiersEx() == 0 ) {
|
||||
// In case of these modifiers java.awt.Container#LightweightDispatcher.processMouseEvent() uses a recent 'active' component
|
||||
// from inner WeakReference (see mouseEventTarget field) even if the component has been already removed from component hierarchy.
|
||||
// So we have to reset this WeakReference with synthetic event just before processing of actual event
|
||||
super.dispatchEvent(new MouseEvent(me.getComponent(), MOUSE_MOVED, me.getWhen(), 0, me.getX(), me.getY(), 0, false, 0));
|
||||
}
|
||||
if (IdeMouseEventDispatcher.patchClickCount(me) && me.getID() == MouseEvent.MOUSE_CLICKED) {
|
||||
final MouseEvent toDispatch =
|
||||
new MouseEvent(me.getComponent(), me.getID(), System.currentTimeMillis(), me.getModifiers(), me.getX(), me.getY(), 1,
|
||||
|
||||
Reference in New Issue
Block a user