diff options
author | Alexander Kurtakov | 2011-12-13 21:17:33 +0000 |
---|---|---|
committer | Silenio Quarti | 2012-01-20 16:21:52 +0000 |
commit | 8bd8c95a40c4a13834c54d0885935faf6a42af88 (patch) | |
tree | b080ce38a54d7069cd541fbc7af75dd595aff415 | |
parent | 29e0063574b85da6c3f780dfda765b40a6fe71e3 (diff) | |
download | eclipse.platform.ui-8bd8c95a40c4a13834c54d0885935faf6a42af88.tar.gz eclipse.platform.ui-8bd8c95a40c4a13834c54d0885935faf6a42af88.tar.xz eclipse.platform.ui-8bd8c95a40c4a13834c54d0885935faf6a42af88.zip |
Make gtk_tooltips_force_window dynamic.
It's only called in special cases and a upper limit for gtk version has
been added to the checks.
5 files changed, 17 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index ef400a98d65..233faf220e0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -14338,7 +14338,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tooltips_1force_1window) (JNIEnv *env, jclass that, jintLong arg0) { OS_NATIVE_ENTER(env, that, _1gtk_1tooltips_1force_1window_FUNC); - gtk_tooltips_force_window((GtkTooltips *)arg0); +/* + gtk_tooltips_force_window(arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_tooltips_force_window) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong))fp)(arg0); + } + } OS_NATIVE_EXIT(env, that, _1gtk_1tooltips_1force_1window_FUNC); } #endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h index fad0944d845..9dbf3616bf6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h @@ -129,6 +129,7 @@ #define gtk_toolbar_set_orientation_LIB LIB_GTK #define gtk_tooltip_trigger_tooltip_query_LIB LIB_GTK #define gtk_tooltips_set_tip_LIB LIB_GTK +#define gtk_tooltips_force_window_LIB LIB_GTK #define gtk_tree_selection_count_selected_rows_LIB LIB_GTK #define gtk_tree_selection_get_selected_rows_LIB LIB_GTK #define gtk_tree_view_column_get_cell_renderers_LIB LIB_GTK diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index fbf666d419a..40e509015c5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -11209,7 +11209,7 @@ public static final int /*long*/ gtk_tooltips_new() { lock.unlock(); } } -/** @param tooltips cast=(GtkTooltips *) */ +/** @method flags=dynamic */ public static final native void _gtk_tooltips_force_window(int /*long*/ tooltips); public static final void gtk_tooltips_force_window(int /*long*/ tooltips) { lock.lock(); 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 af3cc3e3c3c..f13e93ab692 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 @@ -2470,8 +2470,10 @@ void setToolTipText (int /*long*/ rootWidget, int /*long*/ tipWidget, String str * Bug in Solaris-GTK. Invoking gtk_tooltips_force_window() * can cause a crash in older versions of GTK. The fix is * to avoid this call if the GTK version is older than 2.2.x. + * The call is to be avoided on GTK versions newer than 2.12.0 + * where it's deprecated. */ - if (OS.GTK_VERSION >= OS.VERSION (2, 2, 1)) { + if (OS.GTK_VERSION >= OS.VERSION (2, 2, 1) && OS.GTK_VERSION < OS.VERSION (2, 12, 0)) { OS.gtk_tooltips_force_window (tooltipsHandle); } int /*long*/ tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (tooltipsHandle); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java index 919dcff28d5..397666e4fb4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java @@ -270,8 +270,10 @@ void createHandle (int index) { * Bug in Solaris-GTK. Invoking gtk_tooltips_force_window() * can cause a crash in older versions of GTK. The fix is * to avoid this call if the GTK version is older than 2.2.x. + * The call is to be avoided on GTK versions newer than 2.12.0 + * where it's deprecated. */ - if (OS.GTK_VERSION >= OS.VERSION (2, 2, 1)) { + if (OS.GTK_VERSION >= OS.VERSION (2, 2, 1) && OS.GTK_VERSION < OS.VERSION (2, 12, 0)) { OS.gtk_tooltips_force_window (handle); } OS.g_object_ref (handle); |