| Summary: | Missing Event type MouseUp | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Michael Wirth <mwirth> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | ||
| Version: | 3.0 | ||
| Target Milestone: | 3.1 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Fixed in master with change https://git.eclipse.org/r/#/c/67653/ |
In the following scenario a Event from type MouseUp is missing. The base to reproduce is this code (using rap 3.0) @Override protected void createContents(Composite parent) { GridLayout gl = new GridLayout(1, false); parent.setLayout(gl); GridData gd = new GridData(SWT.FILL, SWT.TOP, true, false); Composite above = new Composite(parent, SWT.BORDER); above.setLayout(gl); above.setLayoutData(gd); Button buttonAbove = new Button(above, SWT.TOGGLE); buttonAbove.setText("above"); Button button = new Button(parent, SWT.TOGGLE); button.setText("start"); addListener(button); Composite bottom = new Composite(parent, SWT.BORDER); bottom.setLayout(gl); bottom.setLayoutData(gd); Button buttonBottom = new Button(bottom, SWT.TOGGLE); buttonBottom.setText("bottom"); } private void addListener(Button button) { Listener listener = new Listener() { @Override public void handleEvent(Event event) { switch (event.type) { case SWT.MouseDown: System.out.println("MouseDown"); break; case SWT.MouseUp: System.out.println("MouseUp"); break; } } }; button.addListener(SWT.MouseDown, listener); button.addListener(SWT.MouseUp, listener); } 1. go with the cursor over the button with text 'start' 2. press the mouse button and keep it pressed 3. drag the cursor to the right, over the button with text 'bottom' or to the composite 'bottom' and release the MouseButton --> the Event from type SWT.MouseUp is fired 4. go with the cursor over the button with text 'start' again 5. press the mouse button and keep it pressed 6. drag the cursor over the button with text 'above' or over the composite 'above' and release the mouse button --> the Event is not fired I found this problem in a more complex way while doing drag'n'drop of a Button and this seem to be the root of the problem. In a SWT Application a MouseUp Event is always thrown.