Skip to content

[Windows]The vertical offset of the IME is incorrect when compared with native Windows apps #101642

@moko256

Description

@moko256

Steps to Reproduce

  1. Start flutter app with TextField.
  2. Focus TextField.
  3. Enable IME and start composing.
    I used Microsoft Japanese IME

Expected results:
Between caret and IME window has some spaces.

Notepad Flutter
example with notepad actual example
Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    theme: ThemeData.light(),
    darkTheme: ThemeData.dark(),
    home: const Material(
      child: TextField(expands: true, minLines: null, maxLines: null),
    ),
  ));
}
Logs
[✓] Flutter (Channel master, 2.13.0-0.0.pre.166, on Microsoft Windows [Version 10.0.19044.1620], locale ja-JP)
    • Flutter version 2.13.0-0.0.pre.166 at C:\Users\moko256\softwares\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6af40a7004 (3 weeks ago), 2022-03-19 19:15:23 -0400
    • Engine revision 900e3c0917
    • Dart version 2.17.0 (build 2.17.0-222.0.dev)
    • DevTools version 2.11.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\moko256\AppData\Local\Android\sdk
    • Platform android-32, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

[✓] 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.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.10.31424.327
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2021.1)
    • 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.11+9-b60-7590822)

[✓] VS Code, 64-bit edition (version 1.65.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.24.0

[✓] Connected device (4 available)
    • Windows (desktop)       • windows • windows-x64     • Microsoft Windows [Version 10.0.19044.1620]
    • Windows (UWP) (desktop) • winuwp  • windows-uwp-x64 •
    • Chrome (web)            • chrome  • web-javascript  • Google Chrome 100.0.4896.75
    • Edge (web)              • edge    • web-javascript  • Microsoft Edge 100.0.1185.29

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

The TextInputManagerWin32::MoveImeWindow() is using CFS_CANDIDATEPOS. I replaced it with CFS_EXCLUDE and it works.
I'll create new PR.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopa: fidelityMatching the OEM platforms bettera: internationalizationSupporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-windowsBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions