Skip to content

Commit

Permalink
Fix eclipse-platform#851 Add text/plain;charset=utf-8 to TextTransfer()
Browse files Browse the repository at this point in the history
enables paste from KDE/QT apps in a wayland session.
  • Loading branch information
the-snowwhite authored and mickaelistria committed Nov 8, 2023
1 parent a367fc7 commit 54bcbe3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 54bcbe3

Please sign in to comment.