diff --git a/glfw/x11_window.c b/glfw/x11_window.c index 451636d2a..cf304afab 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -2946,11 +2946,12 @@ _glfwPlatformGetClipboard(GLFWClipboardType clipboard_type, const char* mime_typ } size_t count = 0; if (strcmp(mime_type, "text/plain") == 0) { - // we need to do this because GTK/GNOME is developed by morons - // they convert text/plain to DOS line endings + // UTF8_STRING is what xclip uses by default, and there are people out there that expect to be able to paste from it with a single read operation. See https://github.com/kovidgoyal/kitty/issues/5842 + // Also ancient versions of GNOME use DOS line endings even for text/plain;charset=utf-8. See https://github.com/kovidgoyal/kitty/issues/5528#issuecomment-1325348218 + atoms[count++] = _glfw.x11.UTF8_STRING; + // we need to do this because GTK/GNOME is moronic they convert text/plain to DOS line endings, see // https://gitlab.gnome.org/GNOME/gtk/-/issues/2307 atoms[count++] = atom_for_mime("text/plain;charset=utf-8").atom; - atoms[count++] = _glfw.x11.UTF8_STRING; atoms[count++] = atom_for_mime("text/plain").atom; atoms[count++] = XA_STRING; } else {