Skip to content

Ensure windows are realized before the first frame received.#184956

Merged
robert-ancell merged 3 commits into
flutter:masterfrom
robert-ancell:linux-realize-regular-window
May 4, 2026
Merged

Ensure windows are realized before the first frame received.#184956
robert-ancell merged 3 commits into
flutter:masterfrom
robert-ancell:linux-realize-regular-window

Conversation

@robert-ancell

Copy link
Copy Markdown
Contributor

Regular and dialog windows created using the multi-window APIs receive their first frame from Flutter before they are relized. Explicitly ensure they are realized at creation to avoid this. Copied from the tooltip window code which was doing this correctly.

Avoids warnings like:
** (com.example.multiple_windows:601828): CRITICAL **: 16:25:18.610: gboolean fl_compositor_present_layers(FlCompositor *, const FlutterLayer **, size_t): assertion 'FL_IS_COMPOSITOR(self)' failed

Regular and dialog windows created using the multi-window APIs receive
their first frame from Flutter before they are relized. Explicitly
ensure they are realized at creation to avoid this. Copied from the
tooltip window code which was doing this correctly.

Avoids warnings like:
** (com.example.multiple_windows:601828): CRITICAL **: 16:25:18.610: gboolean fl_compositor_present_layers(FlCompositor *, const FlutterLayer **, size_t): assertion 'FL_IS_COMPOSITOR(self)' failed
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@robert-ancell robert-ancell requested a review from mattkae April 13, 2026 04:26
@github-actions github-actions Bot added the framework flutter/packages/flutter repository. See also f: labels. label Apr 13, 2026
@robert-ancell robert-ancell added CICD Run CI/CD and removed framework flutter/packages/flutter repository. See also f: labels. labels Apr 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds explicit _window.realize() calls to RegularWindowControllerLinux and DialogWindowControllerLinux to address a platform-specific race condition. The review feedback suggests including explanatory comments for these calls to document their purpose, consistent with the repository's style guide regarding useful documentation.

Comment thread packages/flutter/lib/src/widgets/_window_linux.dart
Comment thread packages/flutter/lib/src/widgets/_window_linux.dart
mattkae
mattkae previously approved these changes Apr 13, 2026
@Piinks Piinks added platform-linux Building on or for Linux specifically a: desktop Running on desktop labels Apr 13, 2026
@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. and removed CICD Run CI/CD platform-linux Building on or for Linux specifically a: desktop Running on desktop labels Apr 24, 2026
@robert-ancell robert-ancell enabled auto-merge April 24, 2026 05:24
@robert-ancell robert-ancell requested a review from mattkae April 24, 2026 05:25
@robert-ancell

Copy link
Copy Markdown
Contributor Author

@mattkae needs a re-review since I added some comments.

@mattkae mattkae added the CICD Run CI/CD label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants