Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 21370 Details for
Bug 95222
[KeyBindings] Bindings stop working (no shell activation event)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to "org.eclipse.ui.workbench"
Bug95222-org.eclipse.ui.workbench-r1.patch (text/plain), 9.51 KB, created by
Douglas Pollock
on 2005-05-18 14:58:05 EDT
(
hide
)
Description:
Patch to "org.eclipse.ui.workbench"
Filename:
MIME Type:
Creator:
Douglas Pollock
Created:
2005-05-18 14:58:05 EDT
Size:
9.51 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java,v >retrieving revision 1.4 >diff -u -r1.4 ContextAuthority.java >--- Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java 25 Apr 2005 20:32:54 -0000 1.4 >+++ Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java 18 May 2005 18:57:34 -0000 >@@ -858,4 +858,19 @@ > } > } > } >+ >+ /** >+ * <p> >+ * Bug 95792. A mechanism by which the key binding architecture can force an >+ * update of the contexts (based on the active shell) before trying to >+ * execute a command. This mechanism is required for GTK+ only. >+ * </p> >+ * <p> >+ * DO NOT CALL THIS METHOD. >+ * </p> >+ */ >+ final void updateShellKludge() { >+ updateCurrentState(); >+ sourceChanged(ISources.ACTIVE_SHELL); >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java,v >retrieving revision 1.6 >diff -u -r1.6 ContextService.java >--- Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java 24 Mar 2005 01:01:13 -0000 1.6 >+++ Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java 18 May 2005 18:57:34 -0000 >@@ -127,4 +127,37 @@ > public final boolean unregisterShell(final Shell shell) { > return contextAuthority.unregisterShell(shell); > } >+ >+ /** >+ * <p> >+ * Bug 95792. A mechanism by which the key binding architecture can force an >+ * update of the contexts (based on the active shell) before trying to >+ * execute a command. This mechanism is required for GTK+ only. >+ * </p> >+ * <p> >+ * DO NOT CALL THIS METHOD. >+ * </p> >+ */ >+ public final void updateShellKludge() { >+ contextAuthority.updateShellKludge(); >+ } >+ >+ /** >+ * <p> >+ * Bug 95792. A mechanism by which the key binding architecture can force an >+ * update of the contexts (based on the active shell) before trying to >+ * execute a command. This mechanism is required for GTK+ only. >+ * </p> >+ * <p> >+ * DO NOT CALL THIS METHOD. >+ * </p> >+ * >+ * @param shell >+ * The shell that should be considered active; must not be >+ * <code>null</code>. >+ */ >+ public final void updateShellKludge(final Shell shell) { >+ contextAuthority.sourceChanged(ISources.ACTIVE_SHELL, >+ ISources.ACTIVE_SHELL_NAME, shell); >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java,v >retrieving revision 1.3 >diff -u -r1.3 HandlerAuthority.java >--- Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java 23 Mar 2005 20:19:38 -0000 1.3 >+++ Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java 18 May 2005 18:57:34 -0000 >@@ -25,6 +25,7 @@ > import org.eclipse.core.expressions.IEvaluationContext; > import org.eclipse.ui.ISourceProvider; > import org.eclipse.ui.ISourceProviderListener; >+import org.eclipse.ui.ISources; > import org.eclipse.ui.handlers.IHandlerActivation; > import org.eclipse.ui.internal.misc.Policy; > >@@ -520,4 +521,19 @@ > private final void updateCurrentState() { > fillInCurrentState(context); > } >+ >+ /** >+ * <p> >+ * Bug 95792. A mechanism by which the key binding architecture can force an >+ * update of the handlers (based on the active shell) before trying to >+ * execute a command. This mechanism is required for GTK+ only. >+ * </p> >+ * <p> >+ * DO NOT CALL THIS METHOD. >+ * </p> >+ */ >+ final void updateShellKludge() { >+ updateCurrentState(); >+ sourceChanged(ISources.ACTIVE_SHELL); >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java,v >retrieving revision 1.5 >diff -u -r1.5 HandlerService.java >--- Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java 24 Mar 2005 01:01:13 -0000 1.5 >+++ Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java 18 May 2005 18:57:34 -0000 >@@ -19,6 +19,7 @@ > import org.eclipse.core.commands.IHandler; > import org.eclipse.core.expressions.Expression; > import org.eclipse.core.expressions.IEvaluationContext; >+import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.ISourceProvider; > import org.eclipse.ui.ISources; > import org.eclipse.ui.handlers.IHandlerActivation; >@@ -106,4 +107,37 @@ > public final void removeSourceProvider(final ISourceProvider provider) { > handlerAuthority.removeSourceProvider(provider); > } >+ >+ /** >+ * <p> >+ * Bug 95792. A mechanism by which the key binding architecture can force an >+ * update of the handlers (based on the active shell) before trying to >+ * execute a command. This mechanism is required for GTK+ only. >+ * </p> >+ * <p> >+ * DO NOT CALL THIS METHOD. >+ * </p> >+ */ >+ public final void updateShellKludge() { >+ handlerAuthority.updateShellKludge(); >+ } >+ >+ /** >+ * <p> >+ * Bug 95792. A mechanism by which the key binding architecture can force an >+ * update of the handlers (based on the active shell) before trying to >+ * execute a command. This mechanism is required for GTK+ only. >+ * </p> >+ * <p> >+ * DO NOT CALL THIS METHOD. >+ * </p> >+ * >+ * @param shell >+ * The shell that should be considered active; must not be >+ * <code>null</code>. >+ */ >+ public final void updateShellKludge(final Shell shell) { >+ handlerAuthority.sourceChanged(ISources.ACTIVE_SHELL, >+ ISources.ACTIVE_SHELL_NAME, shell); >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java,v >retrieving revision 1.79 >diff -u -r1.79 WorkbenchKeyboard.java >--- Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java 18 May 2005 18:10:54 -0000 1.79 >+++ Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java 18 May 2005 18:57:34 -0000 >@@ -31,6 +31,7 @@ > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.StyledText; > import org.eclipse.swt.widgets.Combo; >+import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Listener; >@@ -40,8 +41,12 @@ > import org.eclipse.ui.IWindowListener; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.contexts.IContextService; >+import org.eclipse.ui.handlers.IHandlerService; > import org.eclipse.ui.internal.Workbench; > import org.eclipse.ui.internal.WorkbenchPlugin; >+import org.eclipse.ui.internal.contexts.ContextService; >+import org.eclipse.ui.internal.handlers.HandlerService; > import org.eclipse.ui.internal.misc.Policy; > import org.eclipse.ui.internal.util.Util; > import org.eclipse.ui.keys.IBindingService; >@@ -724,6 +729,43 @@ > + potentialKeyStrokes + ")"); //$NON-NLS-1$ > } > >+ /* >+ * KLUDGE. This works around a couple of specific problems in how GTK+ >+ * works. The first problem is the ordering of key press events with >+ * respect to shell activation events. If on the event thread a dialog >+ * is about to open, and the user presses a key, the key press event >+ * will arrive before the shell activation event. From the perspective >+ * of Eclipse, this means that things like two "Open Type" dialogs can >+ * appear if "Ctrl+Shift+T" is pressed twice rapidly. For more >+ * information, please see Bug 95792. The second problem is simply a bug >+ * in GTK+, for which an incomplete workaround currently exists in SWT. >+ * This makes shell activation events unreliable. Please see Bug 56231 >+ * and Bug 95222 for more information. >+ */ >+ if ("gtk".equals(SWT.getPlatform())) { //$NON-NLS-1$ >+ final Widget widget = event.widget; >+ >+ // Update the contexts. >+ final ContextService contextService = (ContextService) workbench >+ .getAdapter(IContextService.class); >+ if ((widget instanceof Control) && (!widget.isDisposed())) { >+ final Shell shell = ((Control) widget).getShell(); >+ contextService.updateShellKludge(shell); >+ } else { >+ contextService.updateShellKludge(); >+ } >+ >+ // Update the handlers. >+ final HandlerService handlerService = (HandlerService) workbench >+ .getAdapter(IHandlerService.class); >+ if ((widget instanceof Control) && (!widget.isDisposed())) { >+ final Shell shell = ((Control) widget).getShell(); >+ handlerService.updateShellKludge(shell); >+ } else { >+ handlerService.updateShellKludge(); >+ } >+ } >+ > KeySequence sequenceBeforeKeyStroke = state.getCurrentSequence(); > for (Iterator iterator = potentialKeyStrokes.iterator(); iterator > .hasNext();) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 95222
:
21263
| 21370