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

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

Issue 10918077: Adding proper dragging behavior for L/R maximized windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: It looks like if git merged wrong here... Created 8 years, 3 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
« 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 85bb0958febdba1d3d66f952cc27a183622a23f7..88c9c9fac4a93bf792f3c2745b8357d44bd6d7a3 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -125,8 +125,11 @@ void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) {
if (wm::IsWindowNormal(window()))
AdjustBoundsForMainWindow(&bounds, grid_size);
if (bounds != window()->bounds()) {
- if (!did_move_or_resize_)
+ if (!did_move_or_resize_) {
+ if (!details_.restore_bounds.IsEmpty())
+ ClearRestoreBounds(window());
RestackWindows();
+ }
did_move_or_resize_ = true;
}
@@ -164,7 +167,9 @@ void WorkspaceWindowResizer::CompleteDrag(int event_flags) {
if (snap_type_ == SNAP_LEFT_EDGE || snap_type_ == SNAP_RIGHT_EDGE) {
if (!GetRestoreBoundsInScreen(window()))
- SetRestoreBoundsInParent(window(), details_.initial_bounds);
+ SetRestoreBoundsInParent(window(), details_.restore_bounds.IsEmpty() ?
+ details_.initial_bounds :
+ details_.restore_bounds);
window()->SetBounds(snap_sizer_->target_bounds());
return;
}
@@ -196,6 +201,9 @@ void WorkspaceWindowResizer::RevertDrag() {
return;
window()->SetBounds(details_.initial_bounds);
+ if (!details_.restore_bounds.IsEmpty())
+ SetRestoreBoundsInScreen(details_.window, details_.restore_bounds);
+
if (details_.window_component == HTRIGHT) {
int last_x = details_.initial_bounds.right();
for (size_t i = 0; i < attached_windows_.size(); ++i) {
« 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