#459 closed defect (fixed)
Null character gets added to the end of clipboard contents while copying from MS Windows
Reported by: | AndrewZ | Owned by: | Antoine Martin |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | client | Version: | 0.10.x |
Keywords: | clipboard, | Cc: |
Description
Both client and server versions are 0.10.9, as indicated by 'About' window and 'xpra --version'.
So, when I do, for example, Win+R -> type 'notepad' -> Ctrl+A -> Ctrl+C, then on my virtualboxes' Ubuntu 13.10 putty command prompt execute
$ xclip -o -selection clipboard | cat -v
, I get
notepad^@
which seems to me to be the case of off-by-one-error. So, I'm no expert in X protocol, but if saving clipboard contents requires putting length of the contents, could you please just decrement it by one?
Change History (13)
comment:1 follow-up: 4 Changed 7 years ago by
Owner: | changed from Antoine Martin to Antoine Martin |
---|---|
Status: | new → assigned |
comment:2 follow-up: 5 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Applied to v0.10.x in r4774. Closing, feel free to re-open if I've missed anything.
comment:4 Changed 7 years ago by
Replying to totaam:
I don't like blindly truncating the
UTF8_STRING
on win32 as this is just an encoding and applications may use UTF8 to transfer data that does have null bytes in it, including at the end of the string.. Just as bad to make this workaround conditional on a specific platform..
But since I can't think of a better solution, r4773 does exactly that.
I'll just put here an advice to report a bug to GTK developers - it's there responsibility from what I've understood.
comment:5 follow-up: 6 Changed 7 years ago by
comment:6 Changed 7 years ago by
comment:7 follow-up: 8 Changed 7 years ago by
I'll just put here an advice to report a bug to GTK developers - it's their responsibility from what I've understood.
It is, but since they've abandoned GTK2 (no updates for almost 2 years) and seem to ignore bug reports, I won't bother :(
Can you please also build it and upload?
I mean, I know it's Python, but I could not find clipboard_base.py on Windows.
py2exe
creates a zip file named library.zip
which contains all the python bits.
If you cannot wait for the upcoming 0.10.10 release, there are 0.11.0 beta win32 packages with the fix here (and 0.11 is now stable enough for day to day usage - also getting close to a release)
comment:8 Changed 7 years ago by
Replying to totaam:
It is, but since they've abandoned GTK2 (no updates for almost 2 years) and seem to ignore bug reports, I won't bother :(
Maybe people from MUTTER project could help? Or do they also use GTK3?
If you cannot wait for the upcoming 0.10.10 release, there are 0.11.0 beta win32 packages with the fix here (and 0.11 is now stable enough for day to day usage - also getting close to a release)
Thanks again!
comment:9 Changed 7 years ago by
Actually 0.11.0 isn't working for me at all. I connect through ssh, then no windows are shown, still plink is running (spawned by Xpra launcher process). Does it require newer beta server than that I see on xpra.org/beta/saucy?
comment:10 Changed 7 years ago by
Actually 0.11.0 isn't working for me at all
Oh snap!
Does it require newer beta client than that I see on xpra.org/beta/saucy?
The new client I uploaded was for win32, the saucy beta packages are much older. You should not need a new server to try the new win32 client though.
comment:12 Changed 7 years ago by
Advice: yes, the usual:
- xpra info on server
- client connection from command line with "
-d all
" - test *nix client with same server
etc..
(in a new ticket please)
comment:13 Changed 6 weeks ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/459
Thanks for the report - it's embarrassing that I never spotted this before, despite using the "
GTK_Clipboard_Tool.exe
" extensively for clipboard testing! (this is not an off-by-one error)Here is some debugging collected with:
I am only including client-side logs as the server doesn't do anything clever with this data.
Here's what happens client side on win32:
xclip
: So it looks like the string we get when we request the data inUTF8_STRING
format claims to be 6 characters long, which includes the null byte at the end.Doing the same thing from a Linux client:
xclip
: And so GTK on Linux clients does the right thing and does not include the null byte in theUTF8_STRING
...I don't like blindly truncating the
UTF8_STRING
on win32 as this is just an encoding and applications may use UTF8 to transfer data that does have null bytes in it, including at the end of the string.. Just as bad to make this workaround conditional on a specific platform..But since I can't think of a better solution, r4773 does exactly that.
I will backport this to v0.10.x