Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,15 @@ - (void)viewDidLayoutSubviews {
[self updateViewportPadding];
[self updateViewportMetrics];

// There is no guarantee that UIKit will layout subviews when the application is active. Creating
// the surface when inactive will cause GPU accesses from the background. Only wait for the first
// frame to render when the application is actually active.
bool applicationIsActive =
[UIApplication sharedApplication].applicationState == UIApplicationStateActive;

// This must run after updateViewportMetrics so that the surface creation tasks are queued after
// the viewport metrics update tasks.
if (firstViewBoundsUpdate) {
if (firstViewBoundsUpdate && applicationIsActive) {
[self surfaceUpdated:YES];

flutter::Shell& shell = [_engine.get() shell];
Expand Down