Repository: flutter
Issue: Selecting TextField or TextFormField causes app to freeze for 20-40 seconds on Linux Mint.
Labels: a: text input,e: device-specific,c: performance,platform-linux,e: OS-version specific,P2,team-linux,triaged-linux

### Steps to reproduce

1. Created a flutter project for linux only using the command `flutter create --platforms=linux textfield_broken`.
2. Copy pasted the code from the "Interactive example" section at the bottom of the page at https://docs.flutter.dev/cookbook/forms/text-input.
3. Run it on Linux Mint 22 Cinnamon.

### Expected results

App to run as shown on the cookbook page and work on every platform whether it be android, linux, windows, etc. i.e., TextField to receive text input and show it on screen and also focusNode to work smoothly.

### Actual results

Code compiled on Linux Mint 22. Worked as expected on web and android phone.
However, on the main machine itself, the app was freezing as soon as any of the TextField or TextFormField was being selected.

Sometimes, after 20-40 seconds, the inputs will be received and displayed on the screen and the app would start to work normally again but unfocusing and clicking on the same or any other TextField or widgets alike would cause the app to freeze for the same amount of time again. FocusNode freezes too and so does the dev tools.

Usually, `{app name} is not responding. Force Quit or Wait` dialogue box pops up. 

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    const appTitle = 'Form Styling Demo';
    return MaterialApp(
      title: appTitle,
      home: Scaffold(
        appBar: AppBar(
          title: const Text(appTitle),
        ),
        body: const MyCustomForm(),
      ),
    );
  }
}

class MyCustomForm extends StatelessWidget {
  const MyCustomForm({super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        const Padding(
          padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
          child: TextField(
            decoration: InputDecoration(
              border: OutlineInputBorder(),
              hintText: 'Enter a search term',
            ),
          ),
        ),
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
          child: TextFormField(
            decoration: const InputDecoration(
              border: UnderlineInputBorder(),
              labelText: 'Enter your username',
            ),
          ),
        ),
      ],
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>


https://github.com/user-attachments/assets/4ca59f41-216f-4872-9ba4-2138b92bff83



</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.24.0, on Linux Mint 22 6.8.0-40-generic, locale en_IN)
    • Flutter version 3.24.0 on channel stable at /home/lav/dev/tooling/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 80c2e84975 (2 weeks ago), 2024-07-30 23:06:49 +0700
    • Engine revision b8800d88be
    • Dart version 3.5.0
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /home/lav/Android/Sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /home/lav/dev/tooling/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/brave-browser

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 18.1.3 (1ubuntu1)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2024.1)
    • Android Studio at /home/lav/dev/tooling/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 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.92.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.94.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Linux Mint 22 6.8.0-40-generic
    • Chrome (web)    • chrome • web-javascript • Brave Browser 127.1.68.141

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>