Skip to content

Linux desktop app just stops updating its window after a while #173447

@Hixie

Description

@Hixie

Steps to reproduce

Run the code below using flutter run -d linux and wait up to 15 minutes (usually a lot less, sometimes less than 10 seconds). All the code does is show a timer on the screen.

Expected results

There should be a counter that increases forever.

Actual results

The timer eventually just appears to hang.

In practice (as tested via debugger), the Dart part of the application is continuing to work fine. It's just the window that isn't updating.

Code sample

import 'dart:async';

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final DateTime _start = DateTime.now();
  
  @override
  Widget build(BuildContext context) {
    scheduleMicrotask(() { setState(() { /* rebuild */ }); });
    return Center(
      child: Text(
        '${DateTime.now().millisecondsSinceEpoch - _start.millisecondsSinceEpoch}ms',
        textDirection: TextDirection.ltr,
      ),
    );
  }
}

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.33.0-1.0.pre-1324, on Ubuntu 24.04.1 LTS 6.8.0-58-generic, locale C.UTF-8) [61ms]
    ! Flutter version 3.33.0-1.0.pre-1324 on channel [user-branch] at /home/ianh/dev/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 796c62bd76 (2 hours ago), 2025-08-07 15:42:16 -0700
    • Engine revision 9264b70f24
    • Dart version 3.10.0 (build 3.10.0-75.1.beta)
    • DevTools version 2.49.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,762ms]
    • Android SDK at /home/ianh/Android/Sdk
    • Emulator version 31.3.13.0 (build_id 9189900) (CL:N/A)
    ✗ Flutter requires Android SDK 36 and the Android BuildTools 28.0.3
      To update the Android SDK visit https://flutter.dev/to/linux-android-setup for detailed instructions.
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Chrome - develop for the web [16ms]
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop [529ms]
    • Ubuntu clang version 18.1.3 (1ubuntu1)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1
    • OpenGL core renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 (X11)
    • OpenGL core version: 4.6.0 NVIDIA 550.120 (X11)
    • OpenGL core shading language version: 4.60 NVIDIA (X11)
    • OpenGL ES renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 (X11)
    • OpenGL ES version: OpenGL ES 3.2 NVIDIA 550.120 (X11)
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20 (X11)
    • GL_EXT_framebuffer_blit: yes (X11)
    • GL_EXT_texture_format_BGRA8888: yes (X11)

[✓] Connected device (2 available) [151ms]
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 24.04.1 LTS 6.8.0-58-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 136.0.7103.59

[✓] Network resources [196ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

While I'm at it:

ianh@burmese:~$ sudo X -version
X.Org X Server 1.21.1.11
X Protocol Version 11, Revision 0
Current Operating System: Linux burmese 6.8.0-58-generic #60-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 14 18:29:48 UTC 2025 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-58-generic root=UUID=dc31e344-a73b-4584-9bbb-d412fe845c85 ro
xorg-server 2:21.1.12-1ubuntu1.4 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.42.2
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Critical issues such as a build break or regressionc: regressionIt was better in the past than it is nowplatform-linuxBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform teamtriaged-linuxTriaged by the Linux platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions