From 54bcbe327b37d67e23a523c76aafdb1c0d4e222b Mon Sep 17 00:00:00 2001 From: the-snowwhite Date: Tue, 7 Nov 2023 07:40:39 +0100 Subject: [PATCH] Fix #851 Add text/plain;charset=utf-8 to TextTransfer() enables paste from KDE/QT apps in a wayland session. --- .../gtk/org/eclipse/swt/dnd/TextTransfer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 2e85db28897..c0cea471819 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 @@ -42,11 +42,11 @@ public class TextTransfer extends ByteArrayTransfer { private static final String COMPOUND_TEXT = "COMPOUND_TEXT"; //$NON-NLS-1$ private static final String UTF8_STRING = "UTF8_STRING"; //$NON-NLS-1$ private static final String STRING = "STRING"; //$NON-NLS-1$ - private static final String TEXTPLAINUTF8 = "text/plain;charset=utf-8"; //RFC-1341 + private static final String TEXT_PLAIN_UTF8 = "text/plain;charset=utf-8"; //RFC-1341 private static final int COMPOUND_TEXT_ID = GTK.GTK4 ? 0 : registerType(COMPOUND_TEXT); private static final int UTF8_STRING_ID = GTK.GTK4 ? 0 : registerType(UTF8_STRING); private static final int STRING_ID = GTK.GTK4 ? 0 : registerType(STRING); - private static final int TEXTPLAINUTF8_ID = GTK.GTK4 ? 0 : registerType(TEXTPLAINUTF8); + private static final int TEXT_PLAIN_UTF8_ID = GTK.GTK4 ? 0 : registerType(TEXT_PLAIN_UTF8); private TextTransfer() {} @@ -147,7 +147,7 @@ protected int[] getTypeIds() { if(GTK.GTK4) { return new int[] {(int) OS.G_TYPE_STRING()}; } - return new int[] {UTF8_STRING_ID, STRING_ID, TEXTPLAINUTF8_ID}; + return new int[] {UTF8_STRING_ID, STRING_ID, TEXT_PLAIN_UTF8_ID}; } @Override @@ -159,7 +159,7 @@ protected String[] getTypeNames() { return new String[] {"text/plain", STRING}; } - return new String[] {UTF8_STRING, STRING, TEXTPLAINUTF8}; + return new String[] {UTF8_STRING, STRING, TEXT_PLAIN_UTF8}; } boolean checkText(Object object) {