diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse')
9 files changed, 16 insertions, 8 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 84c8c8fbf2..611c93c009 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 @@ -582,7 +582,7 @@ int /*long*/ focusHandle () { boolean hasFocus () { if (super.hasFocus ()) return true; - if (entryHandle != 0 && OS.GTK_WIDGET_HAS_FOCUS (entryHandle)) return true; + if (entryHandle != 0 && gtk_widget_has_focus (entryHandle)) return true; return false; } 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 7bdb801a71..251ef8f976 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 @@ -2346,7 +2346,7 @@ public boolean forceFocus () { } boolean forceFocus (int /*long*/ focusHandle) { - if (OS.GTK_WIDGET_HAS_FOCUS (focusHandle)) return true; + if (gtk_widget_has_focus (focusHandle)) return true; /* When the control is zero sized it must be realized */ OS.gtk_widget_realize (focusHandle); OS.gtk_widget_grab_focus (focusHandle); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java index 5bd836678d..6dc6ece648 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java @@ -339,7 +339,7 @@ int /*long*/ gtk_enter_notify_event (int /*long*/ widget, int /*long*/ event) { } boolean hasFocus () { - return OS.GTK_WIDGET_HAS_FOCUS (handle); + return gtk_widget_has_focus (handle); } void hookEvents () { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java index 0aa8fbe8e1..f7dbfe5506 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java @@ -761,7 +761,7 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { * it finishes processing a button press. The fix is to give * focus to the widget before it starts processing the event. */ - if (!OS.GTK_WIDGET_HAS_FOCUS (handle)) { + if (!gtk_widget_has_focus (handle)) { OS.gtk_widget_grab_focus (handle); } return result; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index 2a62e480cc..753c0c1992 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -509,7 +509,7 @@ void bringToTop (boolean force) { if (activeShell == null) return; if (!display.activePending) { int /*long*/ focusHandle = OS.gtk_window_get_focus (activeShell.shellHandle); - if (focusHandle != 0 && !OS.GTK_WIDGET_HAS_FOCUS (focusHandle)) return; + if (focusHandle != 0 && !gtk_widget_has_focus (focusHandle)) return; } } /* diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index e60becf080..fe5c95a298 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -1858,7 +1858,7 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { * it finishes processing a button press. The fix is to give * focus to the widget before it starts processing the event. */ - if (!OS.GTK_WIDGET_HAS_FOCUS (handle)) { + if (!gtk_widget_has_focus (handle)) { OS.gtk_widget_grab_focus (handle); } return result; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index 002686946c..55f335308c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -1546,7 +1546,7 @@ int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ event) { int /*long*/ result = super.gtk_expose_event (widget, event); if ((style & SWT.SINGLE) != 0 && message.length () > 0) { int /*long*/ str = OS.gtk_entry_get_text (handle); - if (!OS.GTK_WIDGET_HAS_FOCUS (handle) && OS.strlen (str) == 0) { + if (!gtk_widget_has_focus (handle) && OS.strlen (str) == 0) { GdkEventExpose gdkEvent = new GdkEventExpose (); OS.memmove (gdkEvent, event, GdkEventExpose.sizeof); int /*long*/ window = paintWindow (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index f46c23ffb9..f70c272ee8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -1861,7 +1861,7 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { * it finishes processing a button press. The fix is to give * focus to the widget before it starts processing the event. */ - if (!OS.GTK_WIDGET_HAS_FOCUS (handle)) { + if (!gtk_widget_has_focus (handle)) { OS.gtk_widget_grab_focus (handle); } return result; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index 778e9bb987..29483d7e28 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -906,6 +906,14 @@ boolean gtk_widget_get_mapped (int /*long*/ widget) { } } +boolean gtk_widget_has_focus (int /*long*/ widget) { + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + return OS.gtk_widget_has_focus (widget); + } else { + return OS.GTK_WIDGET_HAS_FOCUS (widget); + } +} + int /*long*/ gtk_window_state_event (int /*long*/ widget, int /*long*/ event) { return 0; } |