| Summary: | UIMonitorUtility is not equipped to handle applications with more than one shell | ||
|---|---|---|---|
| Product: | [Technology] Subversive | Reporter: | Dan O'Connor <dan_o'connor> |
| Component: | UI | Assignee: | Igor Burilo <igor.burilo> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | dan_o'connor |
| Version: | unspecified | Keywords: | ui |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
The method was reworked and its usage were enforced within the plug-in source code. |
Build Identifier: M20110210-1200 The product I am working on allows more than one workbench window to be opened at the same time. As a result during a sync operation the focus can be switched to the wrong workbench window inadvertently. The issue (or at least part of it) is because org.eclipse.team.svn.ui.utility.UIMonitorUtility does not check if the shell it is returning is the active shell: org.eclipse.team.svn.ui.utility.UIMonitorUtility.java public static Shell getShell() { Display display = UIMonitorUtility.getDisplay(); // NEVER ! use the active shell because it could be disposed asynchronously by external thread for (Shell shell : display.getShells()) { if (shell.getParent() == null) { return shell; } } return new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); } This can easily return the wrong shell, and causes the wrong workbench window to be activated! Reproducible: Always