# HG changeset patch # User dadubrow # Date 1266416729 21600 # Node ID bd54fb1ea34a1842b7726d9834f5df95c1683a1a # Parent bff887fe7694cdd06de93648d872e39a081184b8 Fix bug 10725 -- jam more UI code into syncExec diff -r bff887fe7694 -r bd54fb1ea34a 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 Tue Feb 16 13:44:12 2010 -0600 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/status/ConnectionStatusReconciler.java Wed Feb 17 08:25:29 2010 -0600 @@ -130,27 +130,32 @@ } 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() { + // avoid deadlock with RunRunnableWhenWorkbenchVisibleJob + // if this called as a result of a launch sequence issuing a "select connection" dialog + final Shell shell = WorkbenchUtils.getActiveShell(); + final boolean isVisible[] = { false }; + + if (shell != null) { + Display.getDefault().syncExec(new Runnable() { public void run() { - // try to show the connections view to start service testers - try { - WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); - } catch (PartInitException e) { - } + isVisible[0] = shell.isVisible(); } }); + } + + Runnable runnable = new Runnable() { + public void run() { + try { + WorkbenchUtils.getView(CONNECTIONS_VIEW_ID); + } catch (PartInitException e) { + } + } + }; + + if (!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); } }