Commit 53f36cb4 authored by domlaskowski's avatar domlaskowski Committed by Commit bot

exo: Confine windows to primary display

Multi-display support in ARC was punted to the next milestone. This CL
temporarily prevents windows from being dragged to secondary displays
by using display rather than screen coordinates for window bounds.

BUG=714832
TEST=ARC apps cannot be dragged to secondary displays.

Review-Url: https://codereview.chromium.org/2860863004
Cr-Commit-Position: refs/heads/master@{#469514}
parent beabb626
...@@ -1532,7 +1532,9 @@ void ShellSurface::UpdateWidgetBounds() { ...@@ -1532,7 +1532,9 @@ void ShellSurface::UpdateWidgetBounds() {
const gfx::Rect widget_bounds = widget_->GetWindowBoundsInScreen(); const gfx::Rect widget_bounds = widget_->GetWindowBoundsInScreen();
if (widget_bounds != new_widget_bounds) { if (widget_bounds != new_widget_bounds) {
if (bounds_mode_ != BoundsMode::CLIENT || !resizer_) { if (bounds_mode_ != BoundsMode::CLIENT || !resizer_) {
widget_->SetBounds(new_widget_bounds); // TODO(domlaskowski): Use screen coordinates once multi-display support
// lands in ARC. See crbug.com/718627.
widget_->GetNativeWindow()->SetBounds(new_widget_bounds);
UpdateSurfaceBounds(); UpdateSurfaceBounds();
} else { } else {
// TODO(domlaskowski): Synchronize window state transitions with the // TODO(domlaskowski): Synchronize window state transitions with the
......
...@@ -60,7 +60,9 @@ const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo( ...@@ -60,7 +60,9 @@ const display::ManagedDisplayInfo WMHelperAsh::GetDisplayInfo(
} }
aura::Window* WMHelperAsh::GetContainer(int container_id) { aura::Window* WMHelperAsh::GetContainer(int container_id) {
return ash::Shell::GetContainer(ash::Shell::GetRootWindowForNewWindows(), // TODO(domlaskowski): Use target root window once multi-display support lands
// in ARC. See crbug.com/718627.
return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
container_id); container_id);
} }
......
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