Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Convert cursor rect to device coordinates on Win32#24672

Merged
cbracken merged 2 commits into
flutter-team-archive:masterfrom
cbracken:windows-ime-scale
Feb 27, 2021
Merged

Convert cursor rect to device coordinates on Win32#24672
cbracken merged 2 commits into
flutter-team-archive:masterfrom
cbracken:windows-ime-scale

Conversation

@cbracken

Copy link
Copy Markdown
Contributor

The handlers for the TextInput.setMarkedTextRect and
TextInput.setEditableSizeAndTransform in the win32 embedding deal in
Flutter root view co-ordinates. These need to be converted to window
co-ordinates before being passed to the TextInputManager, which deals in
Win32 window co-ordinates.

This fixes a bug wherein the IME candidates window for CJK input was
incorrectly positioned at display scales other than 100% in the OS
settings.

Fixes: flutter/flutter#76902

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@dkwingsmt

Copy link
Copy Markdown
Contributor

The code looks great, but can you add some tests to avoid regression?

@clarkezone clarkezone left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@cbracken

Copy link
Copy Markdown
Contributor Author

Added a couple tests. Wondering if we should wrap the win32 DPI getting calls up in a class/proc table to make it easier to mock in cases like this. Since we've already got them off in a separate utils translation unit, I might do that in a followup PR.

The handlers for the TextInput.setMarkedTextRect and
TextInput.setEditableSizeAndTransform in the win32 embedding deal in
Flutter root view co-ordinates. These need to be converted to window
co-ordinates before being passed to the TextInputManager, which deals in
Win32 window co-ordinates.

This fixes a bug wherein the IME candidates window for CJK input was
incorrectly positioned at display scales other than 100% in the OS
settings.

Fixes: flutter/flutter#76902
@cbracken cbracken merged commit 8bec65c into flutter-team-archive:master Feb 27, 2021
@cbracken cbracken deleted the windows-ime-scale branch February 27, 2021 22:57
hjfreyer pushed a commit to hjfreyer/engine that referenced this pull request Mar 22, 2021
…ive#24672)

The handlers for the TextInput.setMarkedTextRect and
TextInput.setEditableSizeAndTransform in the win32 embedding deal in
Flutter root view co-ordinates. These need to be converted to window
co-ordinates before being passed to the TextInputManager, which deals in
Win32 window co-ordinates.

This fixes a bug wherein the IME candidates window for CJK input was
incorrectly positioned at display scales other than 100% in the OS
settings.

Fixes: flutter/flutter#76902
chriscraws pushed a commit to chriscraws/engine that referenced this pull request Mar 23, 2021
…ive#24672)

The handlers for the TextInput.setMarkedTextRect and
TextInput.setEditableSizeAndTransform in the win32 embedding deal in
Flutter root view co-ordinates. These need to be converted to window
co-ordinates before being passed to the TextInputManager, which deals in
Win32 window co-ordinates.

This fixes a bug wherein the IME candidates window for CJK input was
incorrectly positioned at display scales other than 100% in the OS
settings.

Fixes: flutter/flutter#76902
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

IME candidate position is incorrect on Win32 desktop embedder

4 participants