Skip to content

Desktop Embedding should be aware of AppLifeCycleState #45270

Closed

Description

@chunhtai

https://api.flutter.dev/flutter/dart-ui/AppLifecycleState-class.html

Currently, the majority of desktop embedding that go through embedder.h does not send AppLifeCycleState message to framework. That means the state is always null. This was ok because framework always enables the frame scheduling if it receives unknown state.

However, with the introducing of detached state, the engine will default to detached state and framework will disable the frame until engine become active. This become a problem because the desktop embedding does not send AppLifeCycleState.resumed message to framework, which causes the framework think engine is never going to be active.

Activity

  1. chunhtai commented on Nov 20, 2019

    @chunhtai
    ContributorAuthor
  2. stuartmorgan-g commented on Nov 20, 2019

    @stuartmorgan-g
    Contributor

    At the risk of beinga broken record: we need to make sure that regardless of what we do with the desktop embeddings here, the default behavior of using the embedding API should not change if at all possible. It's a public API, and it's not supposed to have significant behavioral breaking changes.

    We should have embedder.h/cc default to some behavior that's consistent with how it used to work, then add an opt-in for more detailed lifecycle events if desired.

  3. chunhtai commented on Nov 20, 2019

    @chunhtai
    ContributorAuthor

    One thing we can do is always sends inactive/Resumed lifecycle message to framework when embedder.h FlutterEngineInitialize.

    This might cause problem when the addtoapp extends the work toword desktop, but this should be enough for now

  4. self-assigned this
    on Nov 22, 2019
  5. github-actions commented on Aug 24, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: desktopRunning on desktope: embedderUsers of the Embedder APIengineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions