Bug 74343 - Some contextual views not opening after a perspective switch
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index 92e93a1..df862c2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -530,6 +530,7 @@
 		setActive(page.findView(getSite().getId()) != null);
 		updateObjects();
 		showEditorForCurrentSelection();
+		fContextListener.clearLastEnabledContexts();
 		if (isActive()) {
 			fContextListener.updateForSelection(((IStructuredSelection) getViewer().getSelection()).getFirstElement());
 		}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewContextListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewContextListener.java
index 46635b6..eb57279 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewContextListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewContextListener.java
@@ -998,4 +998,12 @@
 		IWorkbench workbench = PlatformUI.getWorkbench();
 		workbench.getContextSupport().getContextManager().removeContextManagerListener(this);
 	}
+
+	/**
+	 * Clears the cache of last enabled contexts. Called by the debug view when the pespective
+	 * changes.
+	 */
+	protected void clearLastEnabledContexts() {
+		lastEnabledIds.clear();
+	}
 }
\ No newline at end of file