Skip to content

Windows IME #7007

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

Merged
merged 30 commits into from
Dec 12, 2021
Merged

Windows IME #7007

merged 30 commits into from
Dec 12, 2021

Conversation

Mikolaytis
Copy link
Contributor

@Mikolaytis Mikolaytis commented Nov 24, 2021

What does the pull request do?

This is a continue of #6223. I want to fix all issues our QA team have found to make windows IME usable in production.

  • Merged Avalonia master
  • Fixes ApiCompat text file
  • Adds option to enable/disable IME for any InputElement
  • Current SetActive method not disabling IME - it only switches IME back to english letters. This causes issues with input if korean language is selected.
  • Fix IME after dialog show not working - active window context is not applied.
  • Fix IME intermediate input position to be exactly correct/equal with the caret.
  • Fix IME intermediate input font size to be exactly correct/equal with the caret.
  • Fix emoji panel do not update it's position on windows 10 until window activate/deactivate or move.

Resources used to find out how to implement IME:

PS: I'm not a good github user, so I don't know if there was a better solution to contribute to the @yatli PR. So I've created this PR and PR to @yatli repo.

@Mikolaytis Mikolaytis changed the title [WIP] Windows IME Windows IME Nov 25, 2021
@Mikolaytis
Copy link
Contributor Author

Mikolaytis commented Nov 25, 2021

There is a lot we can do more about IME. But for now I think this is a good start. Next step will be - not using composition window - create preEdit support in textBox

@kekekeks

lfHeight = y2-y1,
lfQuality = 5 //CLEARTYPE_QUALITY
};
ImmSetCompositionFont(himc, ref logFont);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also tried hard to get a current font family name, is bold, is italic, is underlined from focused textBox and apply here, but I think @kekekeks will be not so happy about this because it adds a lot of code, so I've decided to provide a lot cleaner solution, and f it's ok - then I will push another PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could optionally provide the current font from ITextInputClient, but that would require also invalidation events and support from the text box. That would also be a breaking change, so it get the feature into 0.10.x we'd need a separate ITextInputClientWithFontInformation interface.

@Mikolaytis
Copy link
Contributor Author

Mikolaytis commented Dec 10, 2021

@kekekeks everything is done 2 weeks ago

@maxkatz6 maxkatz6 enabled auto-merge (squash) December 12, 2021 01:31
@maxkatz6 maxkatz6 merged commit 28a2a2f into AvaloniaUI:master Dec 12, 2021
@maxkatz6 maxkatz6 mentioned this pull request Dec 13, 2021
6 tasks
danwalmsley pushed a commit that referenced this pull request Dec 20, 2021
* win32 ime wip

* ime window starts tracking the cursor, but coords are wrong

* fix win32 ime cursor coord

* win32-ime lang-specific behaviors

* track language id in WindowImpl

* lowercase dllimport

* create initial ime on window creation

* InputMethodManager: connect to client even if im is absent at the moment

* proposal: IKeyboardDevice.NotifyInputMethodUpdated

* finalizing

* ime: allow client to request active state change

* remove backward incompatible ActiveState.

* InputMethodManager: NotifyInputMethodUpdated: filter the window of current focused element

* [IME] [Windows] ability to enable/disable IME for any InputElement

* [IME] [Windows] Refactor Imm32InputMethod - create a single one for dispatcher. Also change a method of enabling/disabling IME to work like in WPF.

* [IME] [Windows] Fix IME after dialog show not working - active window context is not applied.

* [IME] [Windows] fix intermediate input position

* [IME] [Windows] PreEdit font size is applied

* [IME] [Windows] Make MoveImeWindow code to be exact like in chrome - fix a lot of possible issues. Added comments. Minor Refactoring

* [IME] [Windows] Refactor caret management, improve deactivation, remove comments

* [IME] [Windows] Remove redundant api changes (request from @kekekeks)

* Fix .sln and ApiCompatBesaline.txt redundant changes.

* [Windows] [IME] move IsInputMethodEnabled subscription to InputMethodManager, Move check for IsInputMethodEnabled before TextInputMethodClientRequestedEvent query

* [IME] [Windows] remove redundant SetActive(false) call, because it's called in Client setter

* remove redundant change

Co-authored-by: Yatao Li <[email protected]>
Co-authored-by: Max Katz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants