Skip to content

Update embedders to block the platform threads lazily when adding/removing views #146248

@loic-sharma

Description

@loic-sharma

Background

Design: https://flutter.dev/go/multi-view-sync-over-async

Adding/removing a view from the engine is an asynchronous operation. However, desktop embedders expose a synchronous API. Today, desktop embedders block the platform thread until the engine completes the add/remove operation.

Blocking the platform thread like this is unnecessary if the platform thread doesn't use the view immediately.

Solution

Use lazy blocking: only block the platform thread if it attempts to do something that is affected by a pending view add/remove operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: multi windowIssues related to multi window supportengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions