Repository navigation
Description
Steps to reproduce
I'm experiencing a flickering issue with Flutter windows on both Ubuntu 22.04 LTS and Ubuntu 23.10. This issue seems to have arisen in recent versions. I did not encounter this problem in Flutter 3.7.0. Rolling back to that version would require significant changes to dependencies and code, so it is not a feasible solution for me at this moment.
A similar issue was reported in flutter/flutter#120254, but the minimal example provided there does not reproduce the issue in my environment, suggesting that this might be a different problem.
Steps
- Clone the repository:
git clone https://github.com/calcitem/Sanmill.git - Build the project:
cd Sanmill ./flutter-init.sh cd src/ui/flutter_app flutter build linux --release -v - Run the application:
build/linux/x64/release/bundle/mill - Observe the flickering issue when interacting with the GUI.
This issue does not occur on Windows, iOS, or Android using the same version of the Flutter SDK and the same source code.
Expected results
The Flutter window should display without flickering.
Actual results
The window flickers multiple times when clicking on the GUI interface.
Code sample
Code sample
Due to the complexity and size of the code, it is not feasible to provide a simplified version. The complete code can be found here: Sanmill Flutter App Source Code
Screenshots or Video
Screenshots / Video demonstration
Screenshot_Sanmill_Ubuntu_Flutter_Flickers.webm
Logs
Logs
$ mill
Gtk-Message: 13:58:48.597: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
(mill:5041): Gdk-CRITICAL **: 13:58:48.942: gdk_window_get_state: assertion 'GDK_IS_WINDOW (window)' failed
embedder.cc (2844): 'FlutterEngineUpdateLocales' returned 'kInvalidArguments'. Language code is required but not present in FlutterLocale.
$ uname -a
Linux ubuntu-virtual-machine 6.2.0-33-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 10:33:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ glxinfo | grep "Mesa"
client glx vendor string: Mesa Project and SGI
OpenGL core profile version string: 4.3 (Core Profile) Mesa 22.0.5
OpenGL version string: 4.3 (Compatibility Profile) Mesa 22.0.5
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.5
$ glxinfo | grep "OpenGL"
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: SVGA3D; build: RELEASE; LLVM;
OpenGL core profile version string: 4.3 (Core Profile) Mesa 22.0.5
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.3 (Compatibility Profile) Mesa 22.0.5
OpenGL shading language version string: 4.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
$ dpkg -l | grep libgtk-3
ii libgtk-3-0:amd64 3.24.33-1ubuntu2 amd64 GTK graphical user interface library
ii libgtk-3-bin 3.24.33-1ubuntu2 amd64 programs for the GTK graphical user interface library
ii libgtk-3-common 3.24.33-1ubuntu2 all common files for the GTK graphical user interface libraryFlutter Doctor output
Doctor output
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.16.5, on Ubuntu 22.04.1 LTS 6.2.0-33-generic, locale en_US.UTF-8)
• Flutter version 3.16.5 on channel stable at /home/ubuntu/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 78666c8dc5 (12 days ago), 2023-12-19 16:14:14 -0800
• Engine revision 3f3e560236
• Dart version 3.2.3
• DevTools version 2.28.4
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /home/ubuntu/Android/Sdk
• Platform android-33, build-tools 33.0.1
• Java binary at: /snap/android-studio/128/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[✓] Android Studio (version 2022.3)
• Android Studio at /snap/android-studio/128/android-studio
• Flutter plugin version 77.1.1
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version unknown)
• VS Code at /snap/code/current
• Flutter extension version 3.72.0
✗ Unable to determine VS Code version.
[!] Proxy Configuration
• HTTP_PROXY is set
• NO_PROXY is localhost,127.0.0.0/8,::1
• NO_PROXY contains localhost
! NO_PROXY does not contain 127.0.0.1
• NO_PROXY contains ::1
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Ubuntu 22.04.1 LTS 6.2.0-33-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.124
[✓] Network resources
• All expected network resources are available.
Activity
[-][Linux] Flutter Window Flickering on Ubuntu[/-][+][Linux] Flutter Window Flickering on Ubuntu in VMware with 3D Acceleration Enabled[/+]huycozy commentedon Jan 2, 2024
Hi @calcitem
The given code is a complex project so it's not easy to find the caused widget.
You should narrow down the issue by removing the usage of 3rd party plugins/packages one by one, unrelated/unaffected pages, and isolating the affected page into a single
main.dartfile that can be run independently. If the issue's still reproducible, please provide thatmain.dartfile so that we can verify the issue properly. Thanks!github-actions commentedon Jan 23, 2024
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.
github-actions commentedon Feb 6, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.