summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-24 15:46:26 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-28 13:57:50 -0400
commitce67da633501ca7f46ae5739cc12b5af84e7fa58 (patch)
treeb25914510ae2ac351c44bad708a504737972e920 /bundles/org.eclipse.swt/Eclipse SWT Drag and Drop
parent9298b2b5e4c70841e967d5ebec2fff49d69edcf8 (diff)
downloadeclipse.platform.swt-ce67da633501ca7f46ae5739cc12b5af84e7fa58.tar.gz
eclipse.platform.swt-ce67da633501ca7f46ae5739cc12b5af84e7fa58.tar.xz
eclipse.platform.swt-ce67da633501ca7f46ae5739cc12b5af84e7fa58.zip
Omit use of deprecated gdk_utf8_to_compound_text() in newer GTK+
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Drag and Drop')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
index f6de5c5d92..6e2a842c06 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
@@ -76,7 +76,12 @@ public void javaToNative (Object object, TransferData transferData) {
int[] format = new int[1];
int /*long*/[] ctext = new int /*long*/[1];
int[] length = new int[1];
- boolean result = OS.gdk_utf8_to_compound_text(utf8, encoding, format, ctext, length);
+ boolean result;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
+ result = OS.gdk_x11_display_utf8_to_compound_text (OS.gdk_display_get_default(), utf8, encoding, format, ctext, length);
+ } else {
+ result = OS.gdk_utf8_to_compound_text(utf8, encoding, format, ctext, length);
+ }
if (!result) return;
transferData.type = encoding[0];
transferData.format = format[0];