Index: Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java,v retrieving revision 1.34 diff -u -r1.34 PerspectiveSwitcher.java --- Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java 8 Jun 2005 21:36:47 -0000 1.34 +++ Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java 26 Jul 2005 21:25:25 -0000 @@ -260,6 +260,23 @@ } /** + * @return the current location of the perspective bar in terms of + * the string constants defined in IWorkbenchPreferenceConstants. + */ + public String getPerspectiveBarLocation() { + switch (currentLocation) { + case TOP_RIGHT: + return IWorkbenchPreferenceConstants.TOP_RIGHT; + case TOP_LEFT: + return IWorkbenchPreferenceConstants.TOP_LEFT; + case LEFT: + return IWorkbenchPreferenceConstants.LEFT; + default: + return null; + } + } + + /** * Locate the perspective bar according to the provided location * @param preference the location to put the perspective bar at */ Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java,v retrieving revision 1.292 diff -u -r1.292 WorkbenchWindow.java --- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 8 Jul 2005 21:19:20 -0000 1.292 +++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 26 Jul 2005 21:25:26 -0000 @@ -2553,6 +2553,12 @@ actionPresentation.setActionSets(currentPage.getActionSets()); } updateActionBars(); + + if(getCoolBarManager().getItems().length > 0) { + setCoolBarVisible(true); + } else { + setCoolBarVisible(false); + } // hide the launch menu if it is empty String path = IWorkbenchActionConstants.M_WINDOW @@ -2911,15 +2917,20 @@ // @issue this is not ideal; coolbar and perspective shortcuts should be // separately configurable - if ((getCoolBarVisible() && getWindowConfigurer().getShowCoolBar()) - || (getPerspectiveBarVisible() && getWindowConfigurer() - .getShowPerspectiveBar())) { - defaultLayout.addTrim(topBar, SWT.TOP, null); - topBar.setVisible(true); - } else { - defaultLayout.removeTrim(topBar); - topBar.setVisible(false); - } + boolean showCoolBar = getCoolBarVisible() + && getWindowConfigurer().getShowCoolBar(); + boolean showPerspectiveBar = getPerspectiveBarVisible() + && getWindowConfigurer().getShowPerspectiveBar(); + String perspectiveBarLocation = perspectiveSwitcher==null ? null : perspectiveSwitcher.getPerspectiveBarLocation(); + if (showCoolBar + || (showPerspectiveBar && !IWorkbenchPreferenceConstants.LEFT + .equals(perspectiveBarLocation))) { + defaultLayout.addTrim(topBar, SWT.TOP, null); + topBar.setVisible(true); + } else { + defaultLayout.removeTrim(topBar); + topBar.setVisible(false); + } if (getStatusLineVisible() && getWindowConfigurer().getShowStatusLine()) { defaultLayout.addTrim(getStatusLineManager().getControl(),