| Summary: | Events lost focus and get focus are fired two times | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | zzzz <nzanaga> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.0 | ||
| Target Milestone: | 3.1 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://git.eclipse.org/r/#/c/68895/ | ||
| Whiteboard: | |||
I can reproduce it with RAP 3.1M5 too. Fixed with change https://git.eclipse.org/r/#/c/68895/ |
When you put a listener on a shell, events lost / get focus on text controls in the shell, are doubled: I'm using rap-3.0.2-SR2-20160201-1220 Code: [Select all] [Show/ hide] public static void casetestDoubleEventsRAP() { Display display = Display.getDefault(); Shell s = new Shell(); s.addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent event) { System.out.println("shell lost focus"); } @Override public void focusGained(FocusEvent event) { System.out.println("shell get focus"); } }); Text txt1 = new Text(s, SWT.BORDER); txt1.addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent event) { System.out.println("txt1 lost focus"); } @Override public void focusGained(FocusEvent event) { System.out.println("txt1 get focus"); } }); Text txt2 = new Text(s, SWT.BORDER); txt2.addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent event) { System.out.println("txt2 lost focus"); } @Override public void focusGained(FocusEvent event) { System.out.println("txt2 get focus"); } }); s.setLayout(new FillLayout()); s.setBounds(new Rectangle(0, 0, 600, 600)); s.open(); for( ;; ) { if( display.isDisposed() || s.isDisposed() ) return; if( !display.readAndDispatch() ) display.sleep(); } }