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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 11369017: Use correct restore bounds in resizer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « ash/wm/workspace/frame_maximize_button.cc ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index 67145f5db38384e0c769d536bc5a31f3e1a2abbb..8369f66f6a2aa87e0a09c4f8f8358f3778cf47cc 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -327,10 +327,13 @@ void WorkspaceWindowResizer::CompleteDrag(int event_flags) {
// is called, so it does not matter.
if (wm::IsWindowNormal(window()) &&
(snap_type_ == SNAP_LEFT_EDGE || snap_type_ == SNAP_RIGHT_EDGE)) {
- if (!GetRestoreBoundsInScreen(window()))
- SetRestoreBoundsInParent(window(), details_.restore_bounds.IsEmpty() ?
- details_.initial_bounds :
- details_.restore_bounds);
+ if (!GetRestoreBoundsInScreen(window())) {
+ gfx::Rect initial_bounds = ScreenAsh::ConvertRectToScreen(
+ window()->parent(), details_.initial_bounds_in_parent);
+ SetRestoreBoundsInScreen(window(), details_.restore_bounds.IsEmpty() ?
+ initial_bounds :
+ details_.restore_bounds);
+ }
window()->SetBounds(snap_sizer_->target_bounds());
return;
}
@@ -362,12 +365,12 @@ void WorkspaceWindowResizer::RevertDrag() {
if (!did_move_or_resize_)
return;
- window()->SetBounds(details_.initial_bounds);
+ window()->SetBounds(details_.initial_bounds_in_parent);
if (!details_.restore_bounds.IsEmpty())
SetRestoreBoundsInScreen(details_.window, details_.restore_bounds);
if (details_.window_component == HTRIGHT) {
- int last_x = details_.initial_bounds.right();
+ int last_x = details_.initial_bounds_in_parent.right();
for (size_t i = 0; i < attached_windows_.size(); ++i) {
gfx::Rect bounds(attached_windows_[i]->bounds());
bounds.set_x(last_x);
@@ -376,7 +379,7 @@ void WorkspaceWindowResizer::RevertDrag() {
last_x = attached_windows_[i]->bounds().right();
}
} else {
- int last_y = details_.initial_bounds.bottom();
+ int last_y = details_.initial_bounds_in_parent.bottom();
for (size_t i = 0; i < attached_windows_.size(); ++i) {
gfx::Rect bounds(attached_windows_[i]->bounds());
bounds.set_y(last_y);
@@ -474,7 +477,7 @@ void WorkspaceWindowResizer::LayoutAttachedWindows(
gfx::Rect work_area(ScreenAsh::GetDisplayWorkAreaBoundsInParent(window()));
std::vector<int> sizes;
CalculateAttachedSizes(
- PrimaryAxisSize(details_.initial_bounds.size()),
+ PrimaryAxisSize(details_.initial_bounds_in_parent.size()),
PrimaryAxisSize(bounds.size()),
PrimaryAxisCoordinate(bounds.right(), bounds.bottom()),
PrimaryAxisCoordinate(work_area.right(), work_area.bottom()),
« no previous file with comments | « ash/wm/workspace/frame_maximize_button.cc ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698