summaryrefslogtreecommitdiffstats
path: root/ash/wm/workspace
diff options
context:
space:
mode:
Diffstat (limited to 'ash/wm/workspace')
-rw-r--r--ash/wm/workspace/auto_window_management.cc7
-rw-r--r--ash/wm/workspace/frame_maximize_button.cc3
2 files changed, 6 insertions, 4 deletions
diff --git a/ash/wm/workspace/auto_window_management.cc b/ash/wm/workspace/auto_window_management.cc
index f6356bf..067ee9e 100644
--- a/ash/wm/workspace/auto_window_management.cc
+++ b/ash/wm/workspace/auto_window_management.cc
@@ -69,8 +69,11 @@ bool GetOtherVisibleAndManageableWindow(const aura::Window* window,
}
// Get the work area for a given |window|.
-gfx::Rect GetWorkAreaForWindow(aura::Window* window) {
- return Shell::GetScreen()->GetDisplayNearestWindow(window).work_area();
+gfx::Rect GetWorkAreaForWindow(const aura::Window* window) {
+ gfx::Rect work_area = gfx::Rect(window->parent()->bounds().size());
+ work_area.Inset(Shell::GetScreen()->GetDisplayMatching(
+ work_area).GetWorkAreaInsets());
+ return work_area;
}
// Move the given |bounds| on the available |parent_width| to the
diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc
index 683ffc0..f5ca589 100644
--- a/ash/wm/workspace/frame_maximize_button.cc
+++ b/ash/wm/workspace/frame_maximize_button.cc
@@ -597,8 +597,7 @@ FrameMaximizeButton::GetMaximizeBubbleFrameState() const {
return FRAME_STATE_FULL;
// For Left/right maximize we need to check the dimensions.
gfx::Rect bounds = frame_->GetWidget()->GetWindowBoundsInScreen();
- gfx::Rect screen = Shell::GetScreen()->GetDisplayNearestWindow(
- frame_->GetWidget()->GetNativeView()).work_area();
+ gfx::Rect screen = Shell::GetScreen()->GetDisplayMatching(bounds).work_area();
if (bounds.width() < (screen.width() * kMinSnapSizePercent) / 100)
return FRAME_STATE_NONE;
// We might still have a horizontally filled window at this point which we