From 41a21b299bd45546be37141b4dd51b3479c5fea0 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Sat, 7 Aug 2021 22:26:28 +0200 Subject: [PATCH] Do not call CoreWindow::Visible from raster thread (flutter/engine#27760) --- .../shell/platform/windows/flutter_window_winuwp.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/windows/flutter_window_winuwp.cc b/engine/src/flutter/shell/platform/windows/flutter_window_winuwp.cc index bda55263c3..34872c4e18 100644 --- a/engine/src/flutter/shell/platform/windows/flutter_window_winuwp.cc +++ b/engine/src/flutter/shell/platform/windows/flutter_window_winuwp.cc @@ -118,7 +118,13 @@ float FlutterWindowWinUWP::GetDpiScale() { } bool FlutterWindowWinUWP::IsVisible() { - return window_.Visible(); + // This is called from raster thread as an optimization to not wait for vsync + // if window is invisible. However CoreWindow is not agile so we can't call + // Visible() from raster thread. For now assume window is always visible. + // Possible solution would be to register a VisibilityChanged handler and + // store the visiblity state in a variable. TODO(knopp) + // https://github.com/flutter/flutter/issues/87870 + return true; } void FlutterWindowWinUWP::OnDpiChanged(