| Summary: | Shell activate and deactivate events don't fire properly | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Enrico Zanaga <ezanaga> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ivan, maghen.calinghee, webmaster |
| Version: | 1.2 | ||
| Target Milestone: | 1.2 M7 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 245100 | ||
Shell activate/deactivate events are fired in Display#setActiveShell(). Changes in CVS HEAD. |
Having two shells with ShellListeners attached and a button for activate the other shell, the shellActivated and shellDeactivated events don't fire when the setActive method is called. Also, shellDeactivated event doesn't fire in active shell when another shell is created. In SWT the events are always fired correctly. Here's a snippet with a simple log: public class RapTest implements IEntryPoint { private Display d; private Shell s1; private Shell s2; @Override public int createUI() { d = new Display(); s1 = new Shell(d, SWT.SHELL_TRIM | SWT.NO_FOCUS); s2 = new Shell(d, SWT.SHELL_TRIM | SWT.NO_FOCUS); s1.setBounds(0, 0, 400, 200); s2.setBounds(400, 0, 400, 200); s1.setLayout(new FillLayout()); s2.setLayout(new FillLayout()); s1.addShellListener(new ShellAdapter() { @Override public void shellActivated(ShellEvent e) { System.out.println("s1: shellActivated"); } @Override public void shellDeactivated(ShellEvent e) { System.out.println("s1: shellDeactivated"); } }); s2.addShellListener(new ShellAdapter() { @Override public void shellActivated(ShellEvent e) { System.out.println("s2: shellActivated"); } @Override public void shellDeactivated(ShellEvent e) { System.out.println("s2: shellDeactivated"); } }); Button b1 = new Button(s1, SWT.PUSH); Button b2 = new Button(s2, SWT.PUSH); b1.setText("activate s2"); b2.setText("activate s1"); b1.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { System.out.println("b1: widgetSelected"); s2.setActive(); } }); b2.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { System.out.println("b2: widgetSelected"); s1.setActive(); } }); s1.open(); s2.open(); while( !s1.isDisposed() && !s2.isDisposed() ) if( !d.readAndDispatch() ) d.sleep(); d.dispose(); return 0; } }