diff options
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 2 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index b34449a7ea..942aa0c249 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -341,7 +341,7 @@ void clearText () { public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); - if ((style & SWT.READ_ONLY) != 0) { + if ((style & SWT.READ_ONLY) != 0 || menuHandle != 0) { return computeNativeSize (handle, wHint, hHint, changed); } if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; 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; |