Skip to content

Commit

Permalink
Replace AbstractHoverInformationControl on FocusIn
Browse files Browse the repository at this point in the history
With this commit, the hover information control can be replaced on the
focus in event.

contributes to eclipse-platform/eclipse.platform.swt#1540
  • Loading branch information
amartya4256 committed Oct 16, 2024
1 parent 7d29a59 commit 660db66
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public void start(Rectangle subjectArea) {

fDisplay.addFilter(SWT.FocusOut, this);

fDisplay.addFilter(SWT.FocusIn, this);
fDisplay.addFilter(SWT.MouseDown, this);
fDisplay.addFilter(SWT.MouseUp, this);

Expand Down Expand Up @@ -270,6 +271,7 @@ else if (event.type == SWT.MouseVerticalWheel && cancelReplacingDelay())
}
break;

case SWT.FocusIn:
case SWT.MouseUp:
case SWT.MouseDown:
if (!hasInformationControlReplacer())
Expand All @@ -282,7 +284,7 @@ else if (!isReplaceInProgress()) {
if (!(iControl5.containsControl(control))) {
hideInformationControl();
} else if (cancelReplacingDelay()) {
if (event.type == SWT.MouseUp) {
if (event.type == SWT.MouseUp || event.type == SWT.FocusIn) {
stop(); // avoid that someone else replaces the info control before the async is exec'd
if (infoControl instanceof IDelayedInputChangeProvider) {
final IDelayedInputChangeProvider delayedICP= (IDelayedInputChangeProvider) infoControl;
Expand Down Expand Up @@ -335,9 +337,11 @@ private void handleMouseMove(Event event) {
//transform coordinates to subject control:
Point mouseLoc= event.display.map(eventControl, fSubjectControl, event.x, event.y);

if (fSubjectArea.contains(mouseLoc))
if (fSubjectArea.contains(mouseLoc)) {
System.out.println("returning" + event.type);
return;

}
System.out.println("CONTINUING" + event.type);
IInformationControl iControl= getCurrentInformationControl();
if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(iControl)) {
if (AbstractHoverInformationControlManager.this instanceof AnnotationBarHoverManager) {
Expand Down

0 comments on commit 660db66

Please sign in to comment.