Fix issue that breaking IME discards input buffer #14433
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
Breaking IME composition mode discards input composition buffer on windows Korean IME
What is the current behavior?
character is removed when If IME composition mode ends (via space, tab, number, by non-ime keys)
![before-fix](https://private-user-images.githubusercontent.com/1384630/301416515-acc2456a-ecc8-40ed-af38-71ef2c888195.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxOTg0NDYsIm5iZiI6MTczOTE5ODE0NiwicGF0aCI6Ii8xMzg0NjMwLzMwMTQxNjUxNS1hY2MyNDU2YS1lY2M4LTQwZWQtYWYzOC03MWVmMmM4ODgxOTUuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMTQzNTQ2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YThkOWZhNjlhYzI5N2I3MTRlMzg5Y2VmNDMzOGUzOWUyNTU0MDRiYjQ0MzJlZjcwYTU1OTIyMmE3MmUyYzFjZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.-ovF1Ct_z8YL2SPtTqUN3Em8KCk_A5oDy70hPYOt9PA)
What is the updated/expected behavior with this PR?
composition ends, keep the character(s)
![fixed](https://private-user-images.githubusercontent.com/1384630/301416540-09cf4056-7b5c-4342-9d6c-e2b179de84b4.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxOTg0NDYsIm5iZiI6MTczOTE5ODE0NiwicGF0aCI6Ii8xMzg0NjMwLzMwMTQxNjU0MC0wOWNmNDA1Ni03YjVjLTQzNDItOWQ2Yy1lMmIxNzlkZTg0YjQuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMTQzNTQ2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTZiNjhmZGQ1ZjgxMDM0ZTdlYjkyZTFjN2MzZDI2NjY3MWJkOTEyYzliNzc2MTQyNzE1MTFiMjY2ZjhhYTkwNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.vqZPyzIDQRkpunhpXyJIxzfcL48S2UnYTq01Pw9ZOag)
How was the solution implemented (if it's not obvious)?
breaking IME composition puts WM_IME_COMPOSITION to the messaging loop with empty result str (GCS_RESULTSTR)
so it must be handled within WM_IME_ENDCOMPOSITION message.
FYI: One thing I've noticed is that WM_KILLFOCUS interrupts the composition state, but in my experience with IME it shouldn't. It should only be solely handled by WM_IME_*. But I think this requires a significant amount of refactoring.
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues