Commit a5c884c8 authored by Daniel Nicoara's avatar Daniel Nicoara Committed by Commit Bot

cast, exo: Initialize display info list

Depending how early EXO is initialize the Screen object may have already
initialized its display state. When CastWMHelper adds its display
observer it will not get a OnDisplayAdded() event by default. Query the
list and initialize the observer to ensure state is correct.

Bug: b/138247323
Test: Manually on device to verify OnDisplayAdded() is called before EXO
clients call to ask for display info.

Change-Id: I473185fda846e64907eebb808141d51f281fbdde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1720993
Auto-Submit: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681384}
parent 40045e0f
......@@ -53,6 +53,8 @@ CastWMHelper::CastWMHelper(
cast_screen_(cast_screen),
vsync_timing_manager_(this) {
cast_screen_->AddObserver(&display_observer_);
for (const auto& display : cast_screen_->GetAllDisplays())
display_observer_.OnDisplayAdded(display);
}
CastWMHelper::~CastWMHelper() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment