From 901c37db33931067d44ef0838ad456dc01d7d8e1 Mon Sep 17 00:00:00 2001 From: Bogdan Gheorghe Date: Fri, 11 Nov 2011 17:09:18 -0500 Subject: Bug 337269 - ToolTip still visible after calling dispose --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java') 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 ebc7219de2..cd5baff4a7 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 @@ -576,6 +576,7 @@ void register () { void releaseWidget () { super.releaseWidget (); + setVisible(false); if (layoutText != 0) OS.g_object_unref (layoutText); layoutText = 0; if (layoutMessage != 0) OS.g_object_unref (layoutMessage); @@ -803,8 +804,9 @@ public void setVisible (boolean visible) { if ((style & SWT.BALLOON) != 0) { OS.gtk_widget_hide (handle); } else { - int /*long*/ tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (handle); - OS.gtk_widget_hide (tipWindow); + int /*long*/ vboxHandle = parent.vboxHandle; + byte[] buffer = Converter.wcsToMbcs(null, "", true); + OS.gtk_tooltips_set_tip(handle, vboxHandle, buffer, null); } } } -- cgit From 49ddcc0adb99c65d3488fb29ff48ac09fabf497d Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 14 Oct 2011 22:28:31 +0300 Subject: Bug 364769 - Remove gtk_timeout_remove and gtk_timeout_add --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java') 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 cd5baff4a7..8fa7d4b1fb 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 @@ -581,7 +581,7 @@ void releaseWidget () { layoutText = 0; if (layoutMessage != 0) OS.g_object_unref (layoutMessage); layoutMessage = 0; - if (timerId != 0) OS.gtk_timeout_remove(timerId); + if (timerId != 0) OS.g_source_remove(timerId); timerId = 0; text = null; message = null; @@ -782,7 +782,7 @@ public void setText (String string) { */ public void setVisible (boolean visible) { checkWidget (); - if (timerId != 0) OS.gtk_timeout_remove(timerId); + if (timerId != 0) OS.g_source_remove(timerId); timerId = 0; if (visible) { if ((style & SWT.BALLOON) != 0) { @@ -799,7 +799,7 @@ public void setVisible (boolean visible) { OS.GTK_TOOLTIPS_SET_ACTIVE (handle, data); OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); } - if (autohide) timerId = OS.gtk_timeout_add (DELAY, display.windowTimerProc, handle); + if (autohide) timerId = OS.g_timeout_add (DELAY, display.windowTimerProc, handle); } else { if ((style & SWT.BALLOON) != 0) { OS.gtk_widget_hide (handle); -- cgit From fc36e7255b8f05c052b350823b359de456f7d78b Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 9 Nov 2011 23:19:05 +0200 Subject: gtk_tooltips_set_tip is dynamic now Code using it was either conditionalized before or done with this patch. --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java') 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 8fa7d4b1fb..530b331cdf 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 @@ -794,10 +794,14 @@ public void setVisible (boolean visible) { if (text.length () > 0) string.append ("\n\n"); string.append (message); byte [] buffer = Converter.wcsToMbcs (null, string.toString(), true); - OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); - int /*long*/ data = OS.gtk_tooltips_data_get (vboxHandle); - OS.GTK_TOOLTIPS_SET_ACTIVE (handle, data); - OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); + if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) { + OS.gtk_widget_set_tooltip_text(vboxHandle, buffer); + } else { + OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); + int /*long*/ data = OS.gtk_tooltips_data_get (vboxHandle); + OS.GTK_TOOLTIPS_SET_ACTIVE (handle, data); + OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); + } } if (autohide) timerId = OS.g_timeout_add (DELAY, display.windowTimerProc, handle); } else { -- cgit From d063d47bbb5216b9ffb5149930a7861e3c2c535f Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Fri, 25 Nov 2011 23:37:16 +0200 Subject: Protect gtk_tooltips_set tip for gtk prior to version 2.12.0. --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java') 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 530b331cdf..4d58088f3d 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 @@ -810,7 +810,11 @@ public void setVisible (boolean visible) { } else { int /*long*/ vboxHandle = parent.vboxHandle; byte[] buffer = Converter.wcsToMbcs(null, "", true); - OS.gtk_tooltips_set_tip(handle, vboxHandle, buffer, null); + if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) { + OS.gtk_widget_set_tooltip_text(vboxHandle, buffer); + } else { + OS.gtk_tooltips_set_tip(handle, vboxHandle, buffer, null); + } } } } -- cgit