eclipse (3.5.2-6squeeze2) fix-tooltip-color.patch

Summary

 build.xml                   |    1 
 patches/tooltip-color.patch |   47 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

    
download this patch

Patch contents

Description: Backported fix for LP: #540332, poor tooltip text colors
 with certain themes.
Origin: Upstream, https://bugs.eclipse.org/bugs/show_bug.cgi?id=309907
Bug-Ubuntu: https://launchpad.net/bugs/540332

--- a/build.xml
+++ b/build.xml
@@ -263,6 +263,7 @@
 		<patch patchfile="${basedir}/patches/osgi-services-build.patch" dir="${buildDirectory}" strip="1" />
 		<symlink link="${buildDirectory}/plugins/org.eclipse.osgi.services/src/javax" resource="../../org.eclipse.equinox.io/src/javax/" />
 		<patch patchfile="${basedir}/patches/eclipse-swt-compile-xpt.patch" dir="${buildDirectory}" strip="1" />
+		<patch patchfile="${basedir}/patches/tooltip-color.patch" dir="${buildDirectory}" strip="1" />
 		<replace file="${buildDirectory}/plugins/org.eclipse.pde.build/templates/package-build/build.properties" token="/usr/share/eclipse" value="/usr/${libDir}/eclipse" />
 		<chmod dir="${buildDirectory}/plugins/org.eclipse.pde.build/templates/package-build" includes="*.sh" perm="a+x" />
 		<!-- end eclipse-build-only patches -->
--- /dev/null
+++ b/patches/tooltip-color.patch
@@ -0,0 +1,47 @@
+diff -u -r1.25 ToolTip.java
+--- a/plugins/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java	2 Dec 2009 15:52:39 -0000
++++ b/plugins/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java	13 May 2010 15:59:10 -0000
+@@ -48,6 +48,7 @@
+ 	TrayItem item;
+ 	int x, y, timerId;
+ 	int /*long*/ layoutText = 0, layoutMessage = 0;
++	Color layoutTextColor, layoutMessageColor;
+ 	int [] borderPolygon;
+ 	boolean spikeAbove, autohide;
+ 	
+@@ -498,6 +499,9 @@
+ 			x += IMAGE_SIZE;
+ 		}
+ 		x += INSET;
++		if (layoutTextColor != null) {
++			OS.gdk_gc_set_foreground(gdkGC, layoutTextColor.handle);
++		}
+ 		OS.gdk_draw_layout (window, gdkGC, x, y, layoutText);
+ 		int [] w = new int [1], h = new int [1];
+ 		OS.pango_layout_get_size (layoutText, w, h);
+@@ -505,6 +509,9 @@
+ 	}
+ 	if (layoutMessage != 0) {
+ 		x = BORDER + PADDING + INSET;
++		if (layoutMessageColor != null) {
++			OS.gdk_gc_set_foreground(gdkGC, layoutMessageColor.handle);
++		}
+ 		OS.gdk_draw_layout (window, gdkGC, x, y, layoutMessage);
+ 	}
+ 	OS.g_object_unref (gdkGC);
+@@ -708,6 +715,7 @@
+ 	if (layoutMessage != 0) OS.g_object_unref (layoutMessage);
+ 	layoutMessage = 0;
+ 	if (message.length () != 0) {
++		layoutMessageColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
+ 		byte [] buffer = Converter.wcsToMbcs (null, message, true);
+ 		layoutMessage = OS.gtk_widget_create_pango_layout (handle, buffer);
+ 		if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
+@@ -739,6 +747,7 @@
+ 	if (layoutText != 0) OS.g_object_unref (layoutText);
+ 	layoutText = 0;
+ 	if (text.length () != 0) {
++		layoutTextColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
+ 		byte [] buffer = Converter.wcsToMbcs (null, text, true);
+ 		layoutText = OS.gtk_widget_create_pango_layout (handle, buffer);
+ 		if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {