summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java67
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java4
19 files changed, 164 insertions, 35 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties
index 150fa06ee4..4ac5aa41b3 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gtk.OS.properties
@@ -431,6 +431,9 @@ OS_GTK_SCROLLED_WINDOW_VSCROLLBAR_0=cast=(GtkScrolledWindow *)
OS_GTK_TEXTVIEW_IM_CONTEXT=
OS_GTK_TEXTVIEW_IM_CONTEXT_0=cast=(GtkTextView *)
+OS_GTK_TOOLTIPS_TIP_WINDOW=
+OS_GTK_TOOLTIPS_TIP_WINDOW_0=cast=(GtkTooltips *)
+
OS_GTK_WIDGET_HEIGHT=
OS_GTK_WIDGET_HEIGHT_0=cast=(GtkWidget *)
@@ -3237,6 +3240,9 @@ OS__gtk_tooltips_disable_0=cast=(GtkTooltips *)
OS__gtk_tooltips_enable=
OS__gtk_tooltips_enable_0=cast=(GtkTooltips *)
+OS__gtk_tooltips_force_window=
+OS__gtk_tooltips_force_window_0=cast=(GtkTooltips *)
+
OS__gtk_tooltips_new=
OS__gtk_tooltips_set_tip=
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 002ca34572..6163ee714b 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
@@ -161,6 +161,18 @@ JNIEXPORT jint JNICALL OS_NATIVE(GTK_1TEXTVIEW_1IM_1CONTEXT)
}
#endif
+#ifndef NO_GTK_1TOOLTIPS_1TIP_1WINDOW
+JNIEXPORT jint JNICALL OS_NATIVE(GTK_1TOOLTIPS_1TIP_1WINDOW)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, GTK_1TOOLTIPS_1TIP_1WINDOW_FUNC);
+ rc = (jint)GTK_TOOLTIPS_TIP_WINDOW((GtkTooltips *)arg0);
+ OS_NATIVE_EXIT(env, that, GTK_1TOOLTIPS_1TIP_1WINDOW_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_GTK_1WIDGET_1HEIGHT
JNIEXPORT jint JNICALL OS_NATIVE(GTK_1WIDGET_1HEIGHT)
(JNIEnv *env, jclass that, jint arg0)
@@ -9401,6 +9413,16 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tooltips_1enable)
}
#endif
+#ifndef NO__1gtk_1tooltips_1force_1window
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tooltips_1force_1window)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1tooltips_1force_1window_FUNC);
+ gtk_tooltips_force_window((GtkTooltips *)arg0);
+ OS_NATIVE_EXIT(env, that, _1gtk_1tooltips_1force_1window_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1tooltips_1new
JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1tooltips_1new)
(JNIEnv *env, jclass that)
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 97e8ee8913..ec0079d355 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
@@ -76,6 +76,7 @@
#define GTK_WIDGET_SET_X(arg0, arg1) (arg0)->allocation.x = arg1
#define GTK_ENTRY_IM_CONTEXT(arg0) (arg0)->im_context
#define GTK_TEXTVIEW_IM_CONTEXT(arg0) (arg0)->im_context
+#define GTK_TOOLTIPS_TIP_WINDOW(arg0) (arg0)->tip_window
#define GTK_WIDGET_Y(arg0) ((GtkWidget *)arg0)->allocation.y
#define GTK_WIDGET_SET_Y(arg0, arg1) (arg0)->allocation.y = arg1
#define GTK_WIDGET_REQUISITION_WIDTH(arg0) (arg0)->requisition.width
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index b80b340761..76117fd704 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1042;
-int OS_nativeFunctionCallCount[1042];
+int OS_nativeFunctionCount = 1044;
+int OS_nativeFunctionCallCount[1044];
char * OS_nativeFunctionNames[] = {
"Call",
"GDK_1EVENT_1TYPE",
@@ -34,6 +34,7 @@ char * OS_nativeFunctionNames[] = {
"GTK_1SCROLLED_1WINDOW_1SCROLLBAR_1SPACING",
"GTK_1SCROLLED_1WINDOW_1VSCROLLBAR",
"GTK_1TEXTVIEW_1IM_1CONTEXT",
+ "GTK_1TOOLTIPS_1TIP_1WINDOW",
"GTK_1WIDGET_1HEIGHT",
"GTK_1WIDGET_1REQUISITION_1HEIGHT",
"GTK_1WIDGET_1REQUISITION_1WIDTH",
@@ -729,6 +730,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1toolbar_1set_1orientation",
"_1gtk_1tooltips_1disable",
"_1gtk_1tooltips_1enable",
+ "_1gtk_1tooltips_1force_1window",
"_1gtk_1tooltips_1new",
"_1gtk_1tooltips_1set_1tip",
"_1gtk_1tree_1model_1get__III_3II",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index 9bad94f4e7..ae293cf47d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -38,6 +38,7 @@ typedef enum {
GTK_1SCROLLED_1WINDOW_1SCROLLBAR_1SPACING_FUNC,
GTK_1SCROLLED_1WINDOW_1VSCROLLBAR_FUNC,
GTK_1TEXTVIEW_1IM_1CONTEXT_FUNC,
+ GTK_1TOOLTIPS_1TIP_1WINDOW_FUNC,
GTK_1WIDGET_1HEIGHT_FUNC,
GTK_1WIDGET_1REQUISITION_1HEIGHT_FUNC,
GTK_1WIDGET_1REQUISITION_1WIDTH_FUNC,
@@ -733,6 +734,7 @@ typedef enum {
_1gtk_1toolbar_1set_1orientation_FUNC,
_1gtk_1tooltips_1disable_FUNC,
_1gtk_1tooltips_1enable_FUNC,
+ _1gtk_1tooltips_1force_1window_FUNC,
_1gtk_1tooltips_1new_FUNC,
_1gtk_1tooltips_1set_1tip_FUNC,
_1gtk_1tree_1model_1get__III_3II_FUNC,
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 680b4df90a..a2643508b6 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
@@ -530,6 +530,7 @@ public static final native void GTK_ACCEL_LABEL_SET_ACCEL_STRING(int /*long*/ ac
public static final native int /*long*/ GTK_ACCEL_LABEL_GET_ACCEL_STRING(int /*long*/ acce_label);
public static final native int /*long*/ GTK_ENTRY_IM_CONTEXT(int /*long*/ widget);
public static final native int /*long*/ GTK_TEXTVIEW_IM_CONTEXT(int /*long*/ widget);
+public static final native int /*long*/ GTK_TOOLTIPS_TIP_WINDOW(int /*long*/ widget);
public static final native void GTK_WIDGET_SET_HEIGHT(int /*long*/ widget, int height);
public static final native void GTK_WIDGET_SET_WIDTH(int /*long*/ widget, int width);
public static final native void GTK_WIDGET_SET_X(int /*long*/ widget, int x);
@@ -6264,6 +6265,15 @@ public static final int /*long*/ gtk_tooltips_new() {
lock.unlock();
}
}
+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();
+ try {
+ _gtk_tooltips_force_window(tooltips);
+ } finally {
+ lock.unlock();
+ }
+}
public static final native void _gtk_tooltips_set_tip(int /*long*/ tooltips, int /*long*/ widget, byte[] tip_text, byte[] tip_private);
public static final void gtk_tooltips_set_tip(int /*long*/ tooltips, int /*long*/ widget, byte[] tip_text, byte[] tip_private) {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
index 8e644377ff..8db3213320 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
@@ -1241,6 +1241,7 @@ int helpProc (int inControl, int inGlobalMouse, int inRequest, int outContentPro
}
case OS.kHMDisposeContent: {
if (display.helpString != 0) OS.CFRelease (display.helpString);
+ display.helpControl = null;
display.helpString = 0;
break;
}
@@ -2887,6 +2888,11 @@ boolean setTabItemFocus () {
public void setToolTipText (String string) {
checkWidget();
toolTipText = string;
+ if (display.helpControl == this) {
+ display.helpControl = null;
+ OS.HMInstallControlContentCallback (handle, 0);
+ OS.HMInstallControlContentCallback (handle, display.helpProc);
+ }
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java
index 25d223f048..cfec559dc8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java
@@ -623,6 +623,7 @@ int helpProc (int inControl, int inGlobalMouse, int inRequest, int outContentPro
}
case OS.kHMDisposeContent: {
if (display.helpString != 0) OS.CFRelease (display.helpString);
+ display.helpControl = null;
display.helpString = 0;
break;
}
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 2cc864905f..7a0f1c534e 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
@@ -1594,9 +1594,9 @@ public void setTextLimit (int limit) {
OS.gtk_entry_set_max_length (entryHandle, limit);
}
-void setToolTipText (Shell shell, String string) {
- shell.setToolTipText (entryHandle, string);
- shell.setToolTipText (arrowHandle, string);
+void setToolTipText (Shell shell, String newString, String oldString) {
+ shell.setToolTipText (entryHandle, newString, oldString);
+ shell.setToolTipText (arrowHandle, newString, oldString);
}
/**
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 d0690dc1a8..b2f4dc538e 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
@@ -3140,12 +3140,12 @@ boolean setTabItemFocus (boolean next) {
*/
public void setToolTipText (String string) {
checkWidget();
- toolTipText = string;
- setToolTipText (_getShell (), string);
+ setToolTipText (_getShell (), string, toolTipText);
+ toolTipText = string;
}
-void setToolTipText (Shell shell, String string) {
- shell.setToolTipText (eventHandle (), string);
+void setToolTipText (Shell shell, String newString, String oldString) {
+ shell.setToolTipText (eventHandle (), newString, oldString);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 971d79db42..14f82458d4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -171,6 +171,10 @@ public class Display extends Device {
int /*long*/ menuPositionProc;
Callback menuPositionCallback;
+ /* Tooltip size allocate callback */
+ int /*long*/ sizeAllocateProc;
+ Callback sizeAllocateCallback;
+
/* Shell map callback */
int /*long*/ shellMapProc;
Callback shellMapCallback;
@@ -2195,7 +2199,11 @@ void initializeCallbacks () {
menuPositionCallback = new Callback(this, "menuPositionProc", 5);
menuPositionProc = menuPositionCallback.getAddress();
if (menuPositionProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
-
+
+ sizeAllocateCallback = new Callback(this, "sizeAllocateProc", 3);
+ sizeAllocateProc = sizeAllocateCallback.getAddress();
+ if (sizeAllocateProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+
shellMapCallback = new Callback(this, "shellMapProc", 3);
shellMapProc = shellMapCallback.getAddress();
if (shellMapProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
@@ -2829,6 +2837,10 @@ void releaseDisplay () {
menuPositionCallback.dispose (); menuPositionCallback = null;
menuPositionProc = 0;
+ /* Dispose the tooltip map callback */
+ sizeAllocateCallback.dispose (); sizeAllocateCallback = null;
+ sizeAllocateProc = 0;
+
/* Dispose the shell map callback */
shellMapCallback.dispose (); shellMapCallback = null;
shellMapProc = 0;
@@ -3527,6 +3539,12 @@ int /*long*/ textCellDataProc (int /*long*/ tree_column, int /*long*/ cell, int
return widget.textCellDataProc (tree_column, cell, tree_model, iter, data);
}
+int /*long*/ sizeAllocateProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+ Widget widget = getWidget (user_data);
+ if (widget == null) return 0;
+ return widget.sizeAllocateProc (handle, arg0, user_data);
+}
+
int /*long*/ treeSelectionProc (int /*long*/ model, int /*long*/ path, int /*long*/ iter, int /*long*/ data) {
Widget widget = getWidget (data);
if (widget == null) return 0;
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 eb54c250f3..f6c32ec429 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
@@ -100,7 +100,7 @@ import org.eclipse.swt.events.*;
* @see SWT
*/
public class Shell extends Decorations {
- int /*long*/ shellHandle, tooltipsHandle;
+ int /*long*/ shellHandle, tooltipsHandle, tooltipWindow;
boolean mapped, moved, resized, opened;
int oldX, oldY, oldWidth, oldHeight;
int minWidth, minHeight;
@@ -666,8 +666,8 @@ void fixShell (Shell newShell, Control control) {
if (control == lastActive) setActiveControl (null);
String toolTipText = control.toolTipText;
if (toolTipText != null) {
- control.setToolTipText (this, null);
- control.setToolTipText (newShell, toolTipText);
+ control.setToolTipText (this, null, toolTipText);
+ control.setToolTipText (newShell, toolTipText, null);
}
}
@@ -1494,6 +1494,13 @@ void showWidget () {
if (vboxHandle != 0) OS.gtk_widget_show (vboxHandle);
}
+int /*long*/ sizeAllocateProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+ int [] x = new int [1], y = new int [1];
+ OS.gdk_window_get_pointer (0, x, y, null);
+ OS.gtk_window_move (handle, x [0], y [0] + 16);
+ return 0;
+}
+
boolean traverseEscape () {
if (parent == null) return false;
if (!isVisible () || !isEnabled ()) return false;
@@ -1626,10 +1633,10 @@ void releaseWidget () {
lastActive = null;
}
-void setToolTipText (int /*long*/ widget, String string) {
+void setToolTipText (int /*long*/ widget, String newString, String oldString) {
byte [] buffer = null;
- if (string != null && string.length () > 0) {
- buffer = Converter.wcsToMbcs (null, string, true);
+ if (newString != null && newString.length () > 0) {
+ buffer = Converter.wcsToMbcs (null, newString, true);
}
if (tooltipsHandle == 0) {
tooltipsHandle = OS.gtk_tooltips_new ();
@@ -1637,6 +1644,54 @@ void setToolTipText (int /*long*/ widget, String string) {
OS.g_object_ref (tooltipsHandle);
OS.gtk_object_sink (tooltipsHandle);
}
+
+ /*
+ * Feature in GTK. There is no API to position a tooltip.
+ * The fix is to connect to the size_allocate signal for
+ * the tooltip window and position it before it is mapped.
+ */
+ OS.gtk_tooltips_force_window (tooltipsHandle);
+ int /*long*/ tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (tooltipsHandle);
+ if (tipWindow != tooltipWindow) {
+ OS.g_signal_connect (tipWindow, OS.size_allocate, display.sizeAllocateProc, shellHandle);
+ tooltipWindow = tipWindow;
+ }
OS.gtk_tooltips_set_tip (tooltipsHandle, widget, buffer, null);
+
+ /*
+ * Bug in GTK. If the cursor is inside the window when a new
+ * tooltip is set and the old tooltip is null, the new tooltip
+ * is not displayed until the mouse enters the window. The
+ * fix is to cause and enter/leave event to happen by creating
+ * a temporary INPUT_ONLY GDK window.
+ */
+ if ((OS.GTK_WIDGET_FLAGS (widget) & OS.GTK_REALIZED) == 0) return;
+ if ((OS.GTK_WIDGET_FLAGS (widget) & OS.GTK_VISIBLE) == 0) return;
+ if (oldString == null || oldString.length () == 0) {
+ if (newString != null && newString.length () != 0) {
+ int[] x = new int [1], y = new int [1];
+ int /*long*/ window = OS.gdk_window_at_pointer (x, y);
+ if (window != 0) {
+ int /*long*/ [] user_data = new int /*long*/ [1];
+ OS.gdk_window_get_user_data (window, user_data);
+ if (widget == user_data [0]) {
+ int /*long*/ parentHandle = OS.gtk_widget_get_parent (widget);
+ int /*long*/ parentWindow = OS.GTK_WIDGET_WINDOW (parentHandle);
+ GdkWindowAttr attributes = new GdkWindowAttr ();
+ attributes.width = OS.GTK_WIDGET_WIDTH (parentHandle);
+ attributes.height = OS.GTK_WIDGET_HEIGHT (parentHandle);
+ attributes.event_mask = (0xFFFFFFFF & ~OS.ExposureMask);
+ attributes.wclass = OS.GDK_INPUT_ONLY;
+ attributes.window_type = OS.GDK_WINDOW_CHILD;
+ int enterWindow = OS.gdk_window_new (parentWindow, attributes, OS.GDK_WA_X | OS.GDK_WA_Y);
+ if (enterWindow != 0) {
+ OS.gdk_window_raise (enterWindow);
+ OS.gdk_window_show (enterWindow);
+ OS.gdk_window_destroy (enterWindow);
+ }
+ }
+ }
+ }
+ }
}
}
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 7f7dbb1eff..b90ef36f27 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
@@ -873,8 +873,8 @@ void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, De
for (int i=0; i<columnCount; i++) {
TableColumn column = columns [i];
if (column.toolTipText != null) {
- column.setToolTipText(oldShell, null);
- column.setToolTipText(newShell, column.toolTipText);
+ column.setToolTipText(oldShell, null, column.toolTipText);
+ column.setToolTipText(newShell, column.toolTipText, null);
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
index 70dfd114ec..1784368e94 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
@@ -579,13 +579,13 @@ public void setText (String string) {
public void setToolTipText (String string) {
checkWidget();
- toolTipText = string;
Shell shell = parent._getShell ();
- setToolTipText (shell, toolTipText);
+ setToolTipText (shell, string, toolTipText);
+ toolTipText = string;
}
-void setToolTipText (Shell shell, String string) {
- shell.setToolTipText (buttonHandle, string);
+void setToolTipText (Shell shell, String newString, String oldString) {
+ shell.setToolTipText (buttonHandle, newString, oldString);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index 10ddc94c20..a0b5b91217 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -149,8 +149,8 @@ void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, De
for (int i = 0; i < items.length; i++) {
ToolItem item = items [i];
if (item.toolTipText != null) {
- item.setToolTipText(oldShell, null);
- item.setToolTipText(newShell, item.toolTipText);
+ item.setToolTipText(oldShell, null, item.toolTipText);
+ item.setToolTipText(newShell, item.toolTipText, null);
}
}
}
@@ -443,7 +443,9 @@ public void setToolTipText (String string) {
Shell shell = _getShell ();
ToolItem [] items = getItems ();
for (int i = 0; i < items.length; i++) {
- shell.setToolTipText (items [i].handle, string != null ? null : items [i].toolTipText);
+ String newString = string != null ? null : items [i].toolTipText;
+ String oldString = string == null ? null : items [i].toolTipText;
+ shell.setToolTipText (items [i].handle, newString, oldString);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index 69f98b5961..f1799adc56 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -998,15 +998,15 @@ public void setText (String string) {
*/
public void setToolTipText (String string) {
checkWidget();
- toolTipText = string;
if (parent.toolTipText == null) {
Shell shell = parent._getShell ();
- setToolTipText (shell, toolTipText);
+ setToolTipText (shell, string, toolTipText);
}
+ toolTipText = string;
}
-void setToolTipText (Shell shell, String string) {
- shell.setToolTipText (handle, string);
+void setToolTipText (Shell shell, String newString, String oldString) {
+ shell.setToolTipText (handle, newString, oldString);
}
/**
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 ae2dcc4f66..6225e02b2b 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
@@ -801,8 +801,8 @@ void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, De
for (int i=0; i<columnCount; i++) {
TreeColumn column = columns [i];
if (column.toolTipText != null) {
- column.setToolTipText(oldShell, null);
- column.setToolTipText(newShell, column.toolTipText);
+ column.setToolTipText(oldShell, null, column.toolTipText);
+ column.setToolTipText(newShell, column.toolTipText, null);
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
index 643b815bd6..5ef61cb015 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
@@ -569,13 +569,13 @@ public void setText (String string) {
public void setToolTipText (String string) {
checkWidget();
- toolTipText = string;
Shell shell = parent._getShell ();
- setToolTipText (shell, toolTipText);
+ setToolTipText (shell, string, toolTipText);
+ toolTipText = string;
}
-void setToolTipText (Shell shell, String string) {
- shell.setToolTipText (buttonHandle, string);
+void setToolTipText (Shell shell, String newString, String oldString) {
+ shell.setToolTipText (buttonHandle, newString, oldString);
}
/**
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 f20099bdb7..b6525b7645 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
@@ -1326,6 +1326,10 @@ int /*long*/ shellMapProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/
return 0;
}
+int /*long*/ sizeAllocateProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+ return 0;
+}
+
/**
* Returns a string containing a concise, human-readable
* description of the receiver.