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

Side by Side Diff: ash/wm/window_state.cc

Issue 2927003002: Do not adjust subpixel if the window's position is controlled by client. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/window_state.h" 5 #include "ash/wm/window_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/public/cpp/window_properties.h" 9 #include "ash/public/cpp/window_properties.h"
10 #include "ash/public/interfaces/window_pin_type.mojom.h" 10 #include "ash/public/interfaces/window_pin_type.mojom.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 const display::Display display = 445 const display::Display display =
446 display::Screen::GetScreen()->GetDisplayNearestWindow(window_); 446 display::Screen::GetScreen()->GetDisplayNearestWindow(window_);
447 min_size.SetToMin(display.work_area().size()); 447 min_size.SetToMin(display.work_area().size());
448 448
449 actual_new_bounds.set_width( 449 actual_new_bounds.set_width(
450 std::max(min_size.width(), actual_new_bounds.width())); 450 std::max(min_size.width(), actual_new_bounds.width()));
451 actual_new_bounds.set_height( 451 actual_new_bounds.set_height(
452 std::max(min_size.height(), actual_new_bounds.height())); 452 std::max(min_size.height(), actual_new_bounds.height()));
453 } 453 }
454 BoundsSetter().SetBounds(window_, actual_new_bounds); 454 BoundsSetter().SetBounds(window_, actual_new_bounds);
455 wm::SnapWindowToPixelBoundary(window_); 455 if (!allow_set_bounds_direct())
456 wm::SnapWindowToPixelBoundary(window_);
456 } 457 }
457 458
458 void WindowState::SetBoundsConstrained(const gfx::Rect& bounds) { 459 void WindowState::SetBoundsConstrained(const gfx::Rect& bounds) {
459 gfx::Rect work_area_in_parent = 460 gfx::Rect work_area_in_parent =
460 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window_); 461 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window_);
461 gfx::Rect child_bounds(bounds); 462 gfx::Rect child_bounds(bounds);
462 AdjustBoundsSmallerThan(work_area_in_parent.size(), &child_bounds); 463 AdjustBoundsSmallerThan(work_area_in_parent.size(), &child_bounds);
463 SetBoundsDirect(child_bounds); 464 SetBoundsDirect(child_bounds);
464 } 465 }
465 466
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 if (!ignore_property_change_) { 550 if (!ignore_property_change_) {
550 WMEvent event(WMEventTypeFromWindowPinType(GetPinType())); 551 WMEvent event(WMEventTypeFromWindowPinType(GetPinType()));
551 OnWMEvent(&event); 552 OnWMEvent(&event);
552 } 553 }
553 return; 554 return;
554 } 555 }
555 } 556 }
556 557
557 } // namespace wm 558 } // namespace wm
558 } // namespace ash 559 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698