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

Recode incoming text on Windows before input event processing #3290

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

davep
Copy link
Contributor

@davep davep commented Sep 13, 2023

This is a tentative fix for #3178. I'm keeping this as draft for the moment as this affects the Windows input at a very low level, and I'd like the input of @darrenburns and @willmcgugan on if this makes sense. What I do know is that this fixes the problem reported in #3178, and so I suspect there's the core of the solution in here.

So... eyes and experience with handling emoji and the like on this would be welcome.

@davep
Copy link
Contributor Author

davep commented Sep 25, 2023

Moving out of draft for full review as per.

@davep davep marked this pull request as ready for review September 25, 2023 09:27
@davep
Copy link
Contributor Author

davep commented Sep 27, 2023

Merged in main as it's a couple of days since it was put into the review queue.

@willmcgugan
Copy link
Collaborator

Would be awesome if you could find some reference in the win32 docs as to why this is required on Windows, and not elsewhere. But if this is the fix, lets merge.

@darrenburns
Copy link
Member

I spotted a few references to data on the clipboard being encoded as UTF-16 on the MS developer docs, but nothing that stands out to explain exactly why the approach in this PR approach works.

e.g. https://learn.microsoft.com/en-us/dotnet/api/system.windows.clipboard.settext?view=windowsdesktop-7.0

@davep davep merged commit 4684632 into Textualize:main Oct 2, 2023
22 checks passed
@davep davep deleted the win32-emoji-paste-fix branch October 2, 2023 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

app hangs when pasting emoji from clipboard to an Input widget
3 participants