Bug 355118 [Compatibility] 'Git Staging' view has hijacked Ctrl+1

Handler activations done through a part's handler service should only
be active when that part is active. Otherwise, its handlers will leak
up to the workbench window and be found during lookups even if it is
not applicable for the currently active part.
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java
index 0b75185..965e682 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java
@@ -224,7 +224,8 @@
 	 * Initialize the local services.
 	 */
 	private void initializeDefaultServices() {
-		IHandlerService handlerService = new LegacyHandlerService(e4Context);
+		IHandlerService handlerService = new LegacyHandlerService(e4Context,
+				new ActivePartExpression(part));
 		e4Context.set(IHandlerService.class.getName(), handlerService);
 
 		serviceLocator.registerService(IWorkbenchLocationService.class,
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java
index bd7fc74..b469de9 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java
@@ -253,6 +253,12 @@
 		}
 	}
 
+	public LegacyHandlerService(IEclipseContext context, Expression defaultExpression) {
+		eclipseContext = context;
+		evalContext = new ExpressionContext(eclipseContext);
+		this.defaultExpression = defaultExpression;
+	}
+
 	/*
 	 * (non-Javadoc)
 	 *