summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/x/ecore_evas_x.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-03-22 18:39:54 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-03-22 18:39:54 +0000
commite1e7272d89e2921902161be225b53661ca91af8b (patch)
treef95a1f3b5ef9ee522736750fad248d8407ee7bdc /src/modules/ecore_evas/engines/x/ecore_evas_x.c
parentb05110609b38b24f5a11b78bf9a92212da713ce3 (diff)
ecore evas cnp x - fix nul byte extras when text pasting to other apps
i was seeing junk bytes in pastes to chromium... it was an extra nul byte. this will special-case nuke that.
Diffstat (limited to '')
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index ed95594413..3a61baaa20 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -4044,6 +4044,18 @@ _eina_content_converter(char *target, void *data, int size EINA_UNUSED, void **d
4044 *ttype = ecore_x_atom_get(target); //use here target in order to get the correct atom 4044 *ttype = ecore_x_atom_get(target); //use here target in order to get the correct atom
4045 //FIXME in selection manager we never set here the typesize, isn't that weird ? 4045 //FIXME in selection manager we never set here the typesize, isn't that weird ?
4046 ret = EINA_TRUE; 4046 ret = EINA_TRUE;
4047 // XXX: fixup for strings to not include nul byte if last
4048 // byte is nul byte
4049 if (((!strncmp(target, "text/", 5)) ||
4050 (!strcmp(target, "tex")) ||
4051 (!strcmp(target, "TEXT")) ||
4052 (!strcmp(target, "COMPOUND_TEXT")) ||
4053 (!strcmp(target, "STRING")) ||
4054 (!strcmp(target, "UTF8_STRING"))) &&
4055 (slice.len > 0) && (slice.bytes[slice.len - 1] == '\0'))
4056 {
4057 *size_ret = *size_ret - 1;
4058 }
4047 break; 4059 break;
4048 } 4060 }
4049 } 4061 }