Community
Participate
Working Groups
Build Identifier: M20100211-1343 We've been affected by at least two issues in the click event dispatching, which currently does: notifyTable(SWT.MouseEnter); notifyTable(SWT.MouseMove); notifyTable(SWT.Activate); notifyTable(SWT.FocusIn); notifyTable(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); notifyTable(SWT.MouseUp); notifyTable(SWT.Selection, createEvent()); notifyTable(SWT.MouseHover); notifyTable(SWT.MouseMove); notifyTable(SWT.MouseExit); notifyTable(SWT.Deactivate); notifyTable(SWT.FocusOut); The first issue is that Selection normally occurs immediately after MouseDown, i.e. before MouseUp. The second issue is that the MouseUp event (at least) should be a proper mouse event with coordinates, button pressed, etc - in the same way as MouseDown. We believe this is more correct - fixing our specific issue: notifyTable(SWT.MouseEnter); notifyTable(SWT.MouseMove); notifyTable(SWT.Activate); notifyTable(SWT.FocusIn); notifyTable(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); notifyTable(SWT.Selection, createEvent()); notifyTable(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); notifyTable(SWT.MouseHover); notifyTable(SWT.MouseMove); notifyTable(SWT.MouseExit); notifyTable(SWT.Deactivate); notifyTable(SWT.FocusOut); As far as we know, other events might require a proper mouse event? - but our code doesn't rely on these at the moment. Reproducible: Always
Applied this change. The mouse up event should definitely be providing the mouse event, especially given that SWTBot knows the co-ordinates and provides it to the mouse up event. The existing tests pass; I believe this should not break any existing fuctionality.
Same problem in clickXY for SWTBotTreeItem :)
Tim, Which particular method in TreeItem do you refer to ? I'd fixed a lot of these issues a while ago as part of bug 333611. See https://github.com/ketan/SWTBot/commit/1357babfcc2 for the changeset. The current master(https://github.com/ketan/SWTBot/blame/master/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTreeItem.java) has the correct implementation of clickXY as far as I understand, am I missing something obvious ?
Ah, sorry Ketan, that looks good - hadn't seen the other bug. I checked the code from the latest release when I reopened, but I guess that the changes from git hadn't been built into a release at that time.