r/flutterhelp • u/ActEmbarrassed4995 • 8d ago
OPEN Flutter 3.50 Linux app shows black screen on Sway/Wayland, but works on Ubuntu desktop
Hi everyone,
I'm experiencing a rendering issue after upgrading my Flutter Linux application to Flutter 3.50.
The application works perfectly on my Ubuntu development laptop, but on our production device (CoreBox), which runs Sway with native Wayland, the application starts successfully but displays a black/blue screen.
The interesting part is that the application itself seems to be running normally. All services initialize, gRPC connections work, assets are loaded, and the application processes data without any obvious errors.
Environment:
- OS: Ubuntu 26.04.1 LTS
- Kernel: 7.0.0-42-generic
- Flutter: 3.50
- GPU: Intel Tiger Lake (PCI ID
8086:9a78) - GPU driver:
i915 - Compositor: Sway
- Sway renderer:
WLR_RENDERER=gles2 - Wayland socket:
wayland-1 - GTK-based Flutter Linux application
What I've confirmed:
- The application process runs normally.
- Sway recognizes the window as a native Wayland
xdg_shellsurface. - The application is not running through XWayland.
- The Intel GPU driver initializes successfully.
- The application loads its assets and initializes its services.
- There are no obvious fatal GPU errors in
dmesg. WLR_SCENE_DISABLE_DIRECT_SCANOUT=1is already enabled.
Sway reports:
floating_con "gameselector_main"
(xdg_shell, app_id: "gameselector_main")
Environment variables:
WAYLAND_DISPLAY=wayland-1
DISPLAY=:0
XDG_RUNTIME_DIR=/run/user/1000
WLR_RENDERER=gles2
What I'm investigating:
I suspect this might be related to the Linux rendering changes introduced in Flutter 3.50, possibly involving FlViewRendererSubsurface, EGL/OpenGL, or Wayland buffer presentation.
I'm currently adding additional native GTK and Flutter frame diagnostics, along with a minimal rendering test to isolate the issue.
I'm also considering testing Flutter 3.51.0-0.1.pre (beta) to see whether the issue has been fixed.
My questions:
- Has anyone experienced black screens with Flutter 3.50 on Sway or other wlroots-based Wayland compositors?
- Are there known regressions involving
FlViewRendererSubsurfaceor EGL rendering? - Is there a supported way to switch between the old and new Flutter Linux rendering paths for debugging?
- Has anyone tested Flutter 3.51 beta with similar issues?
I'd prefer to keep native Wayland support rather than switching to XWayland.
Any suggestions for debugging this would be greatly appreciated. Thanks!
1
u/karmatics29 8d ago
I haven't hit this exact combination, but since the app logic is clearly fine and only presentation is broken, I'd try to narrow down which layer drops the frames:
WAYLAND_DEBUG=1and look at the surfaces Flutter creates. If the main surface and the subsurface getwl_surface.commitcalls but the subsurface never gets awl_surface.attachwith a buffer (or only gets one once), the problem is on the Flutter/EGL presentation side, not Sway.WLR_RENDERER=vulkan(orpixmanjust as a test). If the window suddenly renders, it's a gles2-in-wlroots plus subsurface interaction, which is worth a wlroots/Sway issue as well.GDK_GL=glesand setGDK_BACKEND=waylandexplicitly. You haveDISPLAY=:0set too, and forcing the backend and GL API removes two variables at once.flutter createcounter app built with 3.50 on the CoreBox. If that's also black, it's a framework/embedder regression and you can bisect quickly by building the same sample with the previous stable on the same device.If the minimal app reproduces it, I'd file it on flutter/flutter with the WAYLAND_DEBUG excerpt and your Sway version. That excerpt makes triage much faster.
1
u/Ok_Consideration_924 7d ago
I had the same issue with some flutter apps, apparently the last Mesa update has broken some things (I'm on Arch so maybe not the same) the last version that i could get to work was `mesa-1:26.2.7`