eclipse/fix-x11-crash-ebz527693.patch

54 lines
2.1 KiB
Diff
Raw Normal View History

From fa50d3f2eca0386f99312210ce0d759d45631ef4 Mon Sep 17 00:00:00 2001
From: Alexander Kurtakov
Date: Mon, 27 Nov 2017 14:26:02 +0200
Subject: Bug 527693 - [Wayland] TextTransfer crash (libX11.so) due to an x11
call gdk_x11_display_utf8_to_compound_text
Compound text is dead technology and fully obsoleted by UTF actually. Do
not claim support for it if not on X11. This should fix the crash.
Change-Id: Id4df68bc3e2052eee88f22a3b06c94537cc6899a
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
---
.../gtk/org/eclipse/swt/dnd/TextTransfer.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/eclipse.platform.swtbundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
index 5da8f52..6148efb 100644
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
@@ -72,7 +72,7 @@ public void javaToNative (Object object, TransferData transferData) {
}
String string = (String)object;
byte[] utf8 = Converter.wcsToMbcs (string, true);
- if (transferData.type == COMPOUND_TEXT_ID) {
+ if (OS.isX11() && transferData.type == COMPOUND_TEXT_ID) {
long /*int*/[] encoding = new long /*int*/[1];
int[] format = new int[1];
long /*int*/[] ctext = new long /*int*/[1];
@@ -136,12 +136,18 @@ public Object nativeToJava(TransferData transferData){
@Override
protected int[] getTypeIds() {
- return new int[] {UTF8_STRING_ID, COMPOUND_TEXT_ID, STRING_ID};
+ if (OS.isX11()) {
+ return new int[] {UTF8_STRING_ID, COMPOUND_TEXT_ID, STRING_ID};
+ }
+ return new int[] {UTF8_STRING_ID, STRING_ID};
}
@Override
protected String[] getTypeNames() {
- return new String[] {UTF8_STRING, COMPOUND_TEXT, STRING};
+ if (OS.isX11()) {
+ return new String[] {UTF8_STRING, COMPOUND_TEXT, STRING};
+ }
+ return new String[] {UTF8_STRING, STRING};
}
boolean checkText(Object object) {
--
cgit v1.1