Commit 8d03afaa authored by domlaskowski's avatar domlaskowski Committed by Commit bot

exo: Fix multi-display cursor crash

The cursor surface is parented to the primary root window, which may
change when using multiple displays. This CL fixes a crash caused by
removing the child from the primary root window when the parent is a
different root window or the child is orphaned.

BUG=714832
TEST=No crashes after changing primary display.

Review-Url: https://codereview.chromium.org/2862953002
Cr-Commit-Position: refs/heads/master@{#469543}
parent 2148f560
......@@ -89,9 +89,8 @@ void Pointer::SetCursor(Surface* surface, const gfx::Point& hotspot) {
}
if (surface_) {
surface_->window()->SetTransform(gfx::Transform());
WMHelper::GetInstance()
->GetContainer(ash::kShellWindowId_MouseCursorContainer)
->RemoveChild(surface_->window());
if (surface_->window()->parent())
surface_->window()->parent()->RemoveChild(surface_->window());
surface_->SetSurfaceDelegate(nullptr);
surface_->RemoveSurfaceObserver(this);
}
......
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