summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-07-10 11:21:19 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-01 09:36:46 -0400
commit2054549f26c019ff25e04cae93704a55f48e14ee (patch)
tree2a1daf91e1d7cd9b0ece2813d2b4111eed58d19f /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt
parent3025d237f680a2e072fde4f6a213f48f2a5248fa (diff)
downloadeclipse.platform.swt-2054549f26c019ff25e04cae93704a55f48e14ee.tar.gz
eclipse.platform.swt-2054549f26c019ff25e04cae93704a55f48e14ee.tar.xz
eclipse.platform.swt-2054549f26c019ff25e04cae93704a55f48e14ee.zip
Use gtk_widget_has_default instead of deprecated GTK_WIDGET_HAS_DEFAULT
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index 77d5d6b13d..3b3b35542e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -492,10 +492,17 @@ int /*long*/ gtk_focus_in_event (int /*long*/ widget, int /*long*/ event) {
int /*long*/ result = super.gtk_focus_in_event (widget, event);
// widget could be disposed at this point
if (handle == 0) return 0;
- if ((style & SWT.PUSH) != 0 && OS.GTK_WIDGET_HAS_DEFAULT (handle)) {
- Decorations menuShell = menuShell ();
- menuShell.defaultButton = this;
- }
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ if ((style & SWT.PUSH) != 0 && OS.gtk_widget_has_default(handle)) {
+ Decorations menuShell = menuShell ();
+ menuShell.defaultButton = this;
+ }
+ }else{
+ if ((style & SWT.PUSH) != 0 && OS.GTK_WIDGET_HAS_DEFAULT (handle)) {
+ Decorations menuShell = menuShell ();
+ menuShell.defaultButton = this;
+ }
+ }
return result;
}