Commit 097ca56d authored by Tim Zheng's avatar Tim Zheng Committed by Commit Bot

Set window bounds once when moving display.

This change avoids set window bounds twice.

BUG=chromium:843001
TEST=Manual test on an eve device.

Change-Id: If08f8e4fd7b8e91db43f265fa8fdc46c3da6eb86
Reviewed-on: https://chromium-review.googlesource.com/1087844Reviewed-by: default avatarStefan Kuhne <skuhne@chromium.org>
Commit-Queue: Tim Zheng <timzheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564749}
parent 70881e87
...@@ -142,15 +142,15 @@ void CrostiniAppWindowShelfController::OnWindowPropertyChanged( ...@@ -142,15 +142,15 @@ void CrostiniAppWindowShelfController::OnWindowPropertyChanged(
crostini_app_display_.GetDisplayIdForStartupId(*startup_id); crostini_app_display_.GetDisplayIdForStartupId(*startup_id);
if (display_id == display::kInvalidDisplayId) if (display_id == display::kInvalidDisplayId)
return; return;
gfx::Rect bounds = window->bounds();
display::Display display; display::Display display;
if (!display::Screen::GetScreen()->GetDisplayWithDisplayId(display_id, if (!display::Screen::GetScreen()->GetDisplayWithDisplayId(display_id,
&display)) &display))
return; return;
window->SetBoundsInScreen(window->GetBoundsInScreen(), display); gfx::Rect bounds = window->bounds();
// The origin of the window is off after the above statement and needs to be gfx::Point origin = display.bounds().origin();
// reset. http://crbug.com/848970. origin.Offset(bounds.x(), bounds.y());
window->SetBounds(bounds); bounds.set_origin(origin);
window->SetBoundsInScreen(bounds, display);
} }
void CrostiniAppWindowShelfController::OnWindowVisibilityChanged( void CrostiniAppWindowShelfController::OnWindowVisibilityChanged(
......
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