# HG changeset patch # User Ed Swartz # Date 1266334147 21600 # Node ID 8c95e3acb3743965ff1741d61c507b1a245e8253 # Parent 1b51db390dc4a0d200376dbaacd9829ef992b16f Fix bug 10725 -- jam more UI code into syncExec diff -r 1b51db390dc4 -r 8c95e3acb374 debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java --- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Mon Feb 15 14:48:52 2010 -0600 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Tue Feb 16 09:29:07 2010 -0600 @@ -131,26 +131,27 @@ private void showConnectionsView() { // avoid deadlock if this called as a result of a launch sequence issuing a "select connection" dialog - Shell shell = WorkbenchUtils.getActiveShell(); - if (shell == null || !shell.isVisible()) { - RunRunnableWhenWorkbenchVisibleJob.start(new Runnable() { - public void run() { - // try to show the connections view to start service testers - try { - WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); - } catch (PartInitException e) { - } + final Shell shell = WorkbenchUtils.getActiveShell(); + final boolean isVisible[] = { true }; + Display.getDefault().syncExec(new Runnable() { + public void run() { + isVisible[0] = shell != null && shell.isVisible(); + } + }); + + Runnable runnable = new Runnable() { + public void run() { + try { + WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); + } catch (PartInitException e) { } - }); + } + }; + + if (shell == null || !isVisible[0]) { + RunRunnableWhenWorkbenchVisibleJob.start(runnable); } else { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - try { - WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); - } catch (PartInitException e) { - } - } - }); + Display.getDefault().asyncExec(runnable); } }