From 066de63c98ed4e9f7a0fb031abd659c80a8f3c05 Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Fri, 22 Jun 2012 12:36:08 -0400 Subject: Bug 383328 - Multiple MoseHover events without moving the mouse --- .../Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index 8b7c8daf1f..798f1d6189 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -634,7 +634,11 @@ void checkEnterExit (Control control, NSEvent nsEvent, boolean send) { } setCursor (control); } - timerExec (control != null && !control.isDisposed() ? getToolTipTime () : -1, hoverTimer); + NSPoint location = NSEvent.mouseLocation(); + if (control == null || control != currentControl || hoverLastLocation == null || location.x != hoverLastLocation.x || location.y != hoverLastLocation.y) { + hoverLastLocation = location; + timerExec (control != null && !control.isDisposed() ? getToolTipTime () : -1, hoverTimer); + } } void checkFocus () { @@ -4214,6 +4218,7 @@ public static void setAppVersion (String version) { } //TODO use custom timer instead of timerExec +NSPoint hoverLastLocation; Runnable hoverTimer = new Runnable () { public void run () { if (currentControl != null && !currentControl.isDisposed()) { -- cgit