Project: SWT
Bug 33496 Multi-line text issues too many mouse track events on Photon (BBAWT)
Reported: 2003-02-27 15:34:19 | Status: resolved fixed

When I add a MouseTrackListener to a multi-line Text widget on Photon, both mouseEntered *and* mouseExit are fired when I pass the mouse over the text widget, and both events are again fired when I move the mouse out of the widget. I would expect only mouseEntered when I pass over and only mouseExited when I mouse out. SWT v2130 QNX 6.1 Testcase: ========= import org.eclipse.swt.SWT; import org.eclipse.swt.events.*; import org.eclipse.swt.events.MouseMoveListener; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.*; public class TestSWTTextAreaMouseTrack { public static void main(String[] args) { Display disp = Display.getDefault(); Shell shell = new Shell(disp); shell.setText("Test SWT MouseTrackListener"); shell.setLayout(new FillLayout()); final Button button = new Button(shell, 0); button.setText("Push"); button.addMouseTrackListener(new MouseTrackAdapter() { public void mouseEnter(MouseEvent e) { System.out.println("button mouseEnter"); } public void mouseExit(MouseEvent e) { System.out.println("button mouseExit"); } }); final Text text = new Text(shell, SWT.MULTI); text.setText("default text"); text.addMouseTrackListener(new MouseTrackAdapter() { public void mouseEnter(MouseEvent e) { System.out.println("text mouseEnter"); } public void mouseExit(MouseEvent e) { System.out.println("text mouseExit"); } }); shell.setSize(200, 200); shell.open(); while (!shell.isDisposed()) { if (!disp.readAndDispatch()) { disp.sleep(); } } } }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Text.java