mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 04:32:05 +00:00
X11: When pasting text/plain try UTF8_STRING first then text/plain/charset=utf-8
Fixes #5842 Also fixes pasting from GTK+2 applications like leafpad.
This commit is contained in:
parent
f831c34813
commit
58497161c0
1 changed files with 4 additions and 3 deletions
7
glfw/x11_window.c
vendored
7
glfw/x11_window.c
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue