Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland_data_source_send sends an extra null byte #6083

Closed
Guldoman opened this issue Aug 18, 2022 · 3 comments
Closed

Wayland_data_source_send sends an extra null byte #6083

Guldoman opened this issue Aug 18, 2022 · 3 comments
Assignees
Milestone

Comments

@Guldoman
Copy link
Contributor

Guldoman commented Aug 18, 2022

When pasting from an SDL Wayland application to another there is an added null byte.

Copying "test" from SDL results in 74 65 73 74 00 (xclip -o -selection clipboard | hexdump -e '/1 "%3.2x"').
Copying "test" from other applications results in 74 65 73 74.

In chromium, pasting text copied from SDL in the address bar results in it showing the added null byte:
image

Maybe there's no need to copy the null byte to the pipe here:

while (write_pipe(fd, mime_data->data, mime_data->length,
&written_bytes) > 0);

Edit:
Funnily enough, I pasted part of the title from an SDL application running under Wayland and the "null byte" shows up when trying to edit it:
Schermata del 2022-08-19 00-54-35

@slouken slouken added this to the 2.24.0 milestone Aug 18, 2022
@slouken
Copy link
Collaborator

slouken commented Aug 18, 2022

This should fix it. Thanks!

@Guldoman
Copy link
Contributor Author

It looks like pasting in the same SDL application is now a bit broken 😅.
I'm getting some garbage after the actual content.

Top is the SDL application I'm copying from, bottom is another instance of the same application (or any other application):
image

I copied 1 from the top application, then pasted three times in both of them.

@slouken slouken reopened this Aug 19, 2022
@slouken slouken self-assigned this Aug 19, 2022
@slouken
Copy link
Collaborator

slouken commented Aug 19, 2022

That was a separate issue, fixed now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants