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

[Windows 7][Desktop]: Unable to input chinese from TextFormField widget on win7 OS with Sogou IME #92164

Closed
wujing-gxl opened this issue Oct 20, 2021 · 8 comments · Fixed by flutter/engine#29620
Assignees
Labels
a: desktop Running on desktop a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems e: OS-version specific Affects only some versions of the relevant operating system engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@wujing-gxl
Copy link

Steps to Reproduce

Always fail on win7 system,win10 is ok,see the gif:
1

Expected results:
TextFormField input:“好的”

Actual results:
TextFormField input:“hd”

Logs
flutter doctor -v
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.17763.2183], locale zh-CN)
    • Flutter version 2.5.3 at D:\thirdsdk\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (5 days ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\wujing\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.4)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.10.31515.178
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.61.1)
    • VS Code at C:\Users\wujing\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.27.0

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.17763.2183]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 94.0.4606.81

! Doctor found issues in 1 category.
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Oct 20, 2021
@darshankawar
Copy link
Member

Since I don't have Windows 7 to verify, I can't replicate this. Keeping it open for further insights from the team.

/cc @cbracken

@darshankawar darshankawar added a: desktop Running on desktop a: internationalization Supporting other languages or locales. (aka i18n) platform-windows Building on or for Windows specifically a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. passed first triage and removed in triage Presently being triaged by the triage team labels Oct 20, 2021
@darshankawar darshankawar changed the title [Windows][Desktop]: Unable to input chinese from TextFormField widget on win7 OS [Windows 7][Desktop]: Unable to input chinese from TextFormField widget on win7 OS Oct 20, 2021
@darshankawar darshankawar added the e: OS-version specific Affects only some versions of the relevant operating system label Oct 20, 2021
@cbracken
Copy link
Member

Copying from #85878:

@Jasonnnn wrote:
When I use Sogou input method to input text on win7, I can only get composition string instead of Chinese characters.
I'm using flutter 2.2.0 now;
However, it works fine on flutter 1.22.4.

When I am sure of the Chinese characters I want, this method
Future _ Handletextinputinvocation (methodcall methodcall) async {},only gives me composition string.
So I guess it's related to flutter Engine.
This problem only appears on win7, and win10 runs very well

Since this has a video and repro steps, keeping this one open and closing the other.

@cbracken
Copy link
Member

cbracken commented Oct 20, 2021

Tagging #92050 for x-reference. That one is a cosmetic issue affecting Win10, but also Sogou input method.

For anyone working on this, the Sogou IME can be installed from https://pinyin.sogou.com/

@gspencergoog gspencergoog added the P2 Important issues not at the top of the work list label Oct 21, 2021
@cbracken
Copy link
Member

cbracken commented Oct 27, 2021

@wujing-gxl can you:

  • attach a code sample that reproduces this
  • paste your flutter doctor output from the Windows 7 machine where this fails?

I was able to get a Windows 7 SP1 machine set up running Flutter and with Sogou installed, but it appears to work for me:

image

Here's my Flutter doctor output:

PS C:\src\jp_flutter> flutter doctor
Building flutter tool...
Running pub upgrade...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 2.6.0-12.0.pre.478, on Microsoft Windows [Version 6.1.7601], locale en-US)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.5)
[!] Android Studio (not installed)
[√] Connected device (1 available)

! Doctor found issues in 3 categories.

@cbracken cbracken added waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds needs repro info Automated crash report whose cause isn't yet known labels Oct 27, 2021
@cbracken
Copy link
Member

cbracken commented Oct 27, 2021

Update here -- I misread part of the original report. I am now able to repro this. The IME candidates list comes up and is keyboard-navigable, but selecting a candidate (either by pressing space, or clicking it in the IME) seems to just end composing instead of replacing the composing range with the result string from the candidates list.

Steps:

  1. Focus the text field
  2. Ensure IME is set to sogou
  3. Input some text (e.g. nihao). The candidates list will appear. Arrow keys work for navigating the candidates list.
  4. Either click the candidate or press enter.

Expected behaviour: Composing text is replaced with the selected candidate
Actual behaviour: Composing ends. Text remains unchanged.

A couple notes to myself or whoever implements this fix:

  • We currently update the composing range on every WM_IME_COMPOSITION event.
  • We do NOT update the composing range on WM_IME_ENDCOMPOSITION events.
  • It's probably worth checking whether it makes a difference if we invoke the OnImeComposition handler in the WM_IME_ENDCOMPOSITION event handler.

@cbracken cbracken removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds needs repro info Automated crash report whose cause isn't yet known labels Oct 27, 2021
@cbracken
Copy link
Member

cbracken commented Oct 27, 2021

I did try out blindly patching in an OnImeComposition call in the WM_IME_ENDCOMPOSITION handler as discussed above, but this didn't work. I haven't looked into this further than that or tried debugging. Just a quick update since I'm jumping back to another bug.

@gspencergoog
Copy link
Contributor

When I try to reproduce this with Sogou, the candidate list disappears when a candidate is selected, but the composing text is also removed from the field (if I started typing with an empty field, it remains empty once I select a candidate). The candidate text does appear in the field while the candidate list is up.

If I use the Windows IME (PRC Simplified, "New Experience" mode), then things appear to operate correctly (although I'm far from an experienced IME user).

(Windows 7 Professional SP1)

@gspencergoog gspencergoog moved this from To do to In progress in Win32 Desktop Stable Nov 3, 2021
@gspencergoog gspencergoog changed the title [Windows 7][Desktop]: Unable to input chinese from TextFormField widget on win7 OS [Windows 7][Desktop]: Unable to input chinese from TextFormField widget on win7 OS with Sogou IME Nov 3, 2021
@gspencergoog gspencergoog moved this from In progress to Review in progress in Win32 Desktop Stable Nov 9, 2021
Win32 Desktop Stable automation moved this from Review in progress to Done Nov 12, 2021
@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Nov 15, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: desktop Running on desktop a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems e: OS-version specific Affects only some versions of the relevant operating system engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants