diff options
author | Paul D'Pong | 2021-02-08 19:29:19 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2021-02-11 11:44:47 +0000 |
commit | 005fa8c55def9a59673fee1220c1d15cbbc06b52 (patch) | |
tree | db976c100ca2982dd0afdbdac6ff2f172f7d91f0 | |
parent | 77ac2b261d777c00533d891a18ca314b6d7c946a (diff) | |
download | eclipse.platform.swt-005fa8c55def9a59673fee1220c1d15cbbc06b52.tar.gz eclipse.platform.swt-005fa8c55def9a59673fee1220c1d15cbbc06b52.tar.xz eclipse.platform.swt-005fa8c55def9a59673fee1220c1d15cbbc06b52.zip |
Bug 571033 - [GTK] Clean up ToolTips Implementation - Removing oldToolTip text
check
- This check is unnecessary as setting the gtk_widget_set_tooltip_text
to the same text again doesn't make it less efficient than doing a
strcmp
- Removed setTooltipText(long, long, String) since the second parameter
"tipWidget" is never used
Change-Id: I1f0ed36c86901fda7430a182b0eec58a87f83929
Signed-off-by: Paul D'Pong <sdamrong@redhat.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 2 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java | 26 |
2 files changed, 8 insertions, 20 deletions
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 330b5f165c..a6522c774f 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 @@ -6016,7 +6016,7 @@ void setToolTipText (Shell shell, String newString) { * under the pointer). */ if (display.currentControl == this) { - shell.setToolTipText (shell.handle, eventHandle (), newString); + shell.setToolTipText(shell.handle, newString); } } 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 7650a37e6e..da8828f95c 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 @@ -3423,28 +3423,16 @@ void releaseWidget () { } } -void setToolTipText (long tipWidget, String string) { - setToolTipText (tipWidget, tipWidget, string); -} - -void setToolTipText (long rootWidget, long tipWidget, String string) { - byte [] buffer = null; - if (string != null && string.length () > 0) { - char [] chars = fixMnemonic (string, false, true); - buffer = Converter.wcsToMbcs (chars, true); +void setToolTipText(long tipWidget, String string) { + byte[] buffer = null; + if (string != null && !string.isEmpty()) { + char[] chars = fixMnemonic(string, false, true); + buffer = Converter.wcsToMbcs(chars, true); } - long oldTooltip = GTK.gtk_widget_get_tooltip_text (rootWidget); - boolean same = false; - if (buffer == null && oldTooltip == 0) { - same = true; - } else if (buffer != null && oldTooltip != 0) { - same = OS.strcmp (oldTooltip, buffer) == 0; - } - if (oldTooltip != 0) OS.g_free(oldTooltip); - if (same) return; - GTK.gtk_widget_set_tooltip_text (rootWidget, buffer); + GTK.gtk_widget_set_tooltip_text(tipWidget, buffer); } + @Override Point getWindowOrigin () { if (!mapped) { |