Skip to content

[macOS] Unable to type text into native textView with IME after destroying Flutter window. #99695

@GetToSet

Description

@GetToSet

Steps to Reproduce

  1. Construct an app with a NSWindow containing a FlutterViewController which has releasedWhenClosed set to YES and another contains native NSTextView.
  2. Close the flutter window.
  3. Switch back to the native window, typing with an IME(e.g Chinese input method)
Recording.2022-03-08.AM12.03.03.mov

Expected results:
Characters typed into the native textView.

Actual results:
Unable to type. IME window resides on the lower left corner of the screen.

Code sample
import AppKit
import FlutterMacOS

class MainFlutterWindow: NSWindow {
    
    override func awakeFromNib() {
        let flutterViewController = FlutterViewController.init()
        let windowFrame = self.frame
        self.contentViewController = flutterViewController
        self.setFrame(windowFrame, display: true)
        self.isReleasedWhenClosed = true

        RegisterGeneratedPlugins(registry: flutterViewController)

        super.awakeFromNib()
    }
    
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopa: 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.frameworkflutter/packages/flutter repository. See also f: labels.platform-macBuilding on or for macOS specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions