Commit 92c64b4c authored by Rafael Cintron's avatar Rafael Cintron Committed by Commit Bot

Fix black window on DWM crash

Freeing DComp resources such as visuals and surfaces causes the
device to become 'dirty'. We must commit the changes to the device
in order for the objects to actually be destroyed.

Leaving the device in the dirty state for long periods of time means
that if DWM.exe crashes, the Chromium window will become black until
the next Commit.

Bug: 1071288,1011655
Change-Id: I7d118e5bc5f1e4fc6959661b1902939ba7dc83f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152784Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#759773}
parent dc7c68c0
......@@ -576,6 +576,15 @@ void DirectCompositionSurfaceWin::Destroy() {
// Destroy presentation helper first because its dtor calls GetHandle.
presentation_helper_ = nullptr;
root_surface_->Destroy();
// Freeing DComp resources such as visuals and surfaces causes the
// device to become 'dirty'. We must commit the changes to the device
// in order for the objects to actually be destroyed.
// Leaving the device in the dirty state for long periods of time means
// that if DWM.exe crashes, the Chromium window will become black until
// the next Commit.
layer_tree_.reset();
dcomp_device_->Commit();
}
gfx::Size DirectCompositionSurfaceWin::GetSize() {
......
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