Repository: flutter
Issue: [Linux] The window title gets ellipsized under stress
Labels: framework,a: typography,platform-linux,a: desktop,has reproducible steps,P2,found in release: 2.10,found in release: 2.13,team-linux,triaged-linux

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Run [`stress`](https://linux.die.net/man/1/stress)
2. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->
3. Observe the window title

**Expected results:** <!-- what did you want to see? -->

The window title is fully visible: "My App", "My App - 1", "My App - 12", "My App - 123"

**Actual results:** <!-- what did you see? -->

The window title is not correctly updated: "My App" -> "My A..."

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```dart
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:window_manager/window_manager.dart';

String formatWindowTitle(String document) {
  return document.isEmpty ? 'My App' : 'My App - $document';
}

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await windowManager.ensureInitialized();

  final document = ValueNotifier<String>('');

  Timer.periodic(const Duration(seconds: 1), (timer) async {
    final name = List.generate(timer.tick % 4, (i) => '${i + 1}').join();
    document.value = name;
    windowManager.setTitle(formatWindowTitle(name));
  });

  runApp(
    ValueListenableBuilder<String>(
      valueListenable: document,
      builder: (context, value, child) {
        return MaterialApp(
          home: Scaffold(
            appBar: AppBar(title: Text(formatWindowTitle(value))),
            body: Center(child: Text(value)),
          ),
        );
      },
    ),
  );
}
```

</details>

<details>
  <summary>Logs</summary>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.10.3, on Ubuntu Jammy Jellyfish (development branch) 5.15.0-23-generic, locale en_US.UTF-8)
    • Flutter version 2.10.3 at /home/jpnurmi/.fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (3 weeks ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/jpnurmi/Android/Sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_SDK_ROOT = /home/jpnurmi/Android/Sdk
    • Java binary at: /home/jpnurmi/Android/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-+rc4-1ubuntu1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2020.3)
    • Android Studio at /home/jpnurmi/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
    • VS Code at /snap/code/current
    • Flutter extension version 3.36.0

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Ubuntu Jammy Jellyfish (development branch) 5.15.0-23-generic

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->
![image](https://user-images.githubusercontent.com/140617/159504739-0d674d37-d14d-4e17-927a-0ff02200d881.png)

More details at https://github.com/jpnurmi/flutter_window_title_issue