Commit 57c7188f authored by Xiaoqian Dai's avatar Xiaoqian Dai Committed by Commit Bot

Speculative fix of ash::SetBoundsInScreen() crash.

It looks like CursorManager::GetDisplay() can return an invalid display,
which then cause Shell::GetRootWindowControllerWithDisplayId(display_id)
to be a nullptr, when then cause ash::SetBoundsInScreen() crash.

Bug: 1068018
Change-Id: I8d590e146755330c94cb0934ccb57085af135e25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422731Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809359}
parent fc3c4c2b
...@@ -143,7 +143,8 @@ void DragWindowResizer::EndDragImpl() { ...@@ -143,7 +143,8 @@ void DragWindowResizer::EndDragImpl() {
// Adjust the size and position so that it doesn't exceed the size of work // Adjust the size and position so that it doesn't exceed the size of work
// area. // area.
display::Display dst_display; display::Display dst_display;
screen->GetDisplayWithDisplayId(dst_display_id, &dst_display); if (!screen->GetDisplayWithDisplayId(dst_display_id, &dst_display))
return;
const gfx::Size& size = dst_display.work_area().size(); const gfx::Size& size = dst_display.work_area().size();
gfx::Rect bounds = GetTarget()->bounds(); gfx::Rect bounds = GetTarget()->bounds();
if (bounds.width() > size.width()) { if (bounds.width() > size.width()) {
......
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