-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Fix IME/CoreTextEditContext not being reset properly #4140
Conversation
BTW the IME integration is still not quite perfect yet. It's truly the easiest to reproduce if you install the chinese language and play around with the editor. For instance if you switch to chinese and press Win. you'll notice that it fails to insert most of the symbols on the "Symbols" tab most of the time, unless you also type some regular words without the use of Win.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I certainly believe this is better, but considering I don't use the IME on a daily basis, I'll hold my green check pending Phil's approval. Thanks for debugging this!
The winrt::param::hstring thing actually infuriates me a little bit. You cannot generally write code that accepts anything automatically convertible to an hstring because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this. Thank you!
Hello @DHowett-MSFT! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
The first argument to
NotifyTextChanged
incorrectly was[0,0]
instead of the length of the text to be removed from the
CoreTextEditContext
.Best source of documentation for
NotifyTextChanged
:https://docs.microsoft.com/en-us/windows/uwp/design/input/custom-text-input#overriding-text-updates
FYI @DHowett-MSFT (just in case): C++/WinRT uses
winrt::param::hstring
for string parameters which intelligently borrows strings. As such you
can simply pass a
std::wstring
to most WinRT methods without the needof having to allocate an intermediate
hstring
. 🙂Validation Steps Performed
I followed the reproduction instructions of #3706 and #3745 and ensured
the issue doesn't happen anymore.
Closes #3645
Closes #3706
Closes #3745