Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1923)

Unified Diff: ash/wm/default_state.cc

Issue 424463002: Makes a window that has been resized to maximized bounds, then maximized and then restored shrink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Maximizes a window that has been resized to maximized bounds (only update size when unmaximizing) Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/wm/default_state.cc
diff --git a/ash/wm/default_state.cc b/ash/wm/default_state.cc
index 0fd3070dcfcb39ec6b4d369c4619ff16ecc87f1e..6f6d0ac2fd8d50fa5c026d8693bafd08da44f7f4 100644
--- a/ash/wm/default_state.cc
+++ b/ash/wm/default_state.cc
@@ -511,10 +511,17 @@ void DefaultState::UpdateBoundsFromState(WindowState* window_state,
case WINDOW_STATE_TYPE_NORMAL: {
gfx::Rect work_area_in_parent =
ScreenUtil::GetDisplayWorkAreaBoundsInParent(window_state->window());
- if (window_state->HasRestoreBounds())
+ if (window_state->HasRestoreBounds()) {
bounds_in_parent = window_state->GetRestoreBoundsInParent();
- else
+ if (previous_state_type == WINDOW_STATE_TYPE_MAXIMIZED &&
+ bounds_in_parent == work_area_in_parent) {
+ // Inset the bounds slightly so that they are not exactly same as
+ // work area bounds and it is easier to resize the window.
+ bounds_in_parent.Inset(10, 10, 10, 10);
pkotwicz 2014/07/31 03:39:57 |bounds_in_parent| might be bigger than |work_area
varkha 2014/08/01 21:00:24 I think checking for a larger size should solve it
+ }
+ } else {
bounds_in_parent = window->bounds();
+ }
// Make sure that part of the window is always visible.
AdjustBoundsToEnsureMinimumWindowVisibility(
work_area_in_parent, &bounds_in_parent);
« no previous file with comments | « no previous file | ash/wm/window_state_unittest.cc » ('j') | chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698