summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index ec35babb3f..fb6ac2cc49 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -3100,19 +3100,18 @@ int /*long*/ gtk_focus_out_event (int /*long*/ widget, int /*long*/ event) {
}
int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ event) {
+ if (!hasFocus ()) return 0;
GdkEventKey gdkEvent = new GdkEventKey ();
OS.memmove (gdkEvent, event, GdkEventKey.sizeof);
-
- if (filterKey (gdkEvent.keyval, event)) return 1;
- // widget could be disposed at this point
- if (isDisposed ()) return 0;
-
- if (!hasFocus ()) return 0;
if (translateMnemonic (gdkEvent.keyval, gdkEvent)) return 1;
// widget could be disposed at this point
if (isDisposed ()) return 0;
+ if (filterKey (gdkEvent.keyval, event)) return 1;
+ // widget could be disposed at this point
+ if (isDisposed ()) return 0;
+
if (translateTraversal (gdkEvent)) return 1;
// widget could be disposed at this point
if (isDisposed ()) return 0;