Skip to content

Commit f640247

Browse files
committed
Add MouseEnter & MouseMove Event in PopupCloser
This commit adds MouseEnter and MouseMove event in the PopupCloser, as Edge browser can only react to mouse movements and not mouse clicks. This also makes the beahviour of PopupCloser consistent with AbstractHoverInformationControl:Closer. fixes eclipse-platform/eclipse.platform.swt#2072
1 parent 1d2f499 commit f640247

File tree

1 file changed

+9
-1
lines changed
  • bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist

1 file changed

+9
-1
lines changed

bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/PopupCloser.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ public void install(ContentAssistant contentAssistant, Table table, AdditionalIn
109109

110110
fDisplay.addFilter(SWT.Deactivate, this);
111111
fDisplay.addFilter(SWT.MouseUp, this);
112+
113+
fDisplay.addFilter(SWT.MouseMove, this);
114+
fDisplay.addFilter(SWT.MouseEnter, this);
112115
}
113116
}
114117

@@ -130,6 +133,9 @@ public void uninstall() {
130133

131134
fDisplay.removeFilter(SWT.Deactivate, this);
132135
fDisplay.removeFilter(SWT.MouseUp, this);
136+
137+
fDisplay.removeFilter(SWT.MouseMove, this);
138+
fDisplay.removeFilter(SWT.MouseEnter, this);
133139
}
134140
}
135141

@@ -206,6 +212,8 @@ else if (event.type == SWT.MouseVerticalWheel)
206212
}
207213
break;
208214

215+
case SWT.MouseEnter:
216+
case SWT.MouseMove:
209217
case SWT.MouseUp:
210218
if (fAdditionalInfoController == null || fAdditionalInfoController.getInternalAccessor().isReplaceInProgress())
211219
break;
@@ -224,7 +232,7 @@ else if (event.type == SWT.MouseVerticalWheel)
224232
}
225233

226234
// XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=212392 :
227-
control.getShell().getDisplay().asyncExec(() -> fAdditionalInfoController.getInternalAccessor().replaceInformationControl(true));
235+
fAdditionalInfoController.getInternalAccessor().replaceInformationControl(event.type == SWT.MouseUp);
228236
}
229237
}
230238
}

0 commit comments

Comments
 (0)