Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-11-10 01:29:09 +0000
committerMichael Valenta2004-11-10 01:29:09 +0000
commit43c77040880e8c1bb02779e3c4f8e5b6ea651005 (patch)
treed467da060d5f1235618ae3f9aa332e30e9d55a37
parent25fcf8cd066fe36e5a61392c0db2afe6b744d260 (diff)
downloadeclipse.platform.team-43c77040880e8c1bb02779e3c4f8e5b6ea651005.tar.gz
eclipse.platform.team-43c77040880e8c1bb02779e3c4f8e5b6ea651005.tar.xz
eclipse.platform.team-43c77040880e8c1bb02779e3c4f8e5b6ea651005.zip
Bug 75801 All workbench windows blocked
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
index 99d737836..1adcdb3ed 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
@@ -290,15 +290,21 @@ public class Utils {
}
public static Shell findShell() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if(window != null) {
- return window.getShell();
- }
+ // First find the active shell of the display and use it.
+ // We need to do this since the active shell may be model
+ // in which case we nned to parent off that or risk deadlock
Display display= Display.getCurrent();
if (display == null) {
display= Display.getDefault();
+ }
+ if (display != null) {
return display.getActiveShell();
}
+ // Try to use the active window (although I suspect this will fail if the bove failed)
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if(window != null) {
+ return window.getShell();
+ }
// worst case, just create our own.
return new Shell(TeamUIPlugin.getStandardDisplay());
}

Back to the top