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

Unified Diff: ash/wm/dock/docked_window_layout_manager.cc

Issue 1149153007: Ignores programmatic bounds changes for docked windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ignores programmatic bounds changes for docked windows (comments) Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/dock/docked_window_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/dock/docked_window_layout_manager.cc
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
index 63e8090021cbb6adafba842d616605c788ce1ae9..9320a6f1a4069c7f374a08def35a57f322b23800 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -210,8 +210,9 @@ bool IsPopupOrTransient(const aura::Window* window) {
::wm::GetTransientParent(window));
}
-// Certain windows (minimized, hidden or popups) do not matter to docking.
-bool IsUsedByLayout(const aura::Window* window) {
+// Certain windows (minimized, hidden or popups) are not docked and are ignored
+// by layout logic even when they are children of a docked container.
+bool IsWindowDocked(const aura::Window* window) {
return (window->IsVisible() &&
!wm::GetWindowState(window)->IsMinimized() &&
!IsPopupOrTransient(window));
@@ -479,8 +480,7 @@ void DockedWindowLayoutManager::StartDragging(aura::Window* window) {
WindowResizer::kBoundsChangeDirection_Horizontal)) {
for (size_t i = 0; i < dock_container_->children().size(); ++i) {
aura::Window* window1(dock_container_->children()[i]);
- if (IsUsedByLayout(window1) &&
- window1 != dragged_window_ &&
+ if (IsWindowDocked(window1) && window1 != dragged_window_ &&
window1->bounds().width() == docked_width_) {
wm::GetWindowState(window1)->set_bounds_changed_by_user(false);
}
@@ -745,6 +745,8 @@ void DockedWindowLayoutManager::SetChildBounds(
actual_new_bounds.set_height(
std::max(min_size.height(), actual_new_bounds.height()));
}
+ if (IsWindowDocked(child) && child != dragged_window_)
+ return;
SnapToPixelLayoutManager::SetChildBounds(child, actual_new_bounds);
if (IsPopupOrTransient(child))
return;
@@ -938,7 +940,7 @@ void DockedWindowLayoutManager::MaybeMinimizeChildrenExcept(
aura::Window::Windows::const_reverse_iterator iter = children.rbegin();
while (iter != children.rend()) {
aura::Window* window(*iter++);
- if (window == child || !IsUsedByLayout(window))
+ if (window == child || !IsWindowDocked(window))
continue;
int room_needed = GetWindowHeightCloseTo(window, 0) +
(gap_needed ? kMinDockGap : 0);
@@ -1015,7 +1017,7 @@ void DockedWindowLayoutManager::RecordUmaAction(DockedAction action,
if (IsPopupOrTransient(window))
continue;
docked_all_count++;
- if (!IsUsedByLayout(window))
+ if (!IsWindowDocked(window))
continue;
docked_visible_count++;
if (window->type() == ui::wm::WINDOW_TYPE_PANEL)
@@ -1076,7 +1078,7 @@ void DockedWindowLayoutManager::Relayout() {
for (size_t i = 0; i < dock_container_->children().size(); ++i) {
aura::Window* window(dock_container_->children()[i]);
- if (!IsUsedByLayout(window) || window == dragged_window_)
+ if (!IsWindowDocked(window) || window == dragged_window_)
continue;
// If the shelf is currently hidden (full-screen mode), hide window until
@@ -1316,7 +1318,7 @@ void DockedWindowLayoutManager::UpdateStacking(aura::Window* active_window) {
for (aura::Window::Windows::const_iterator it =
dock_container_->children().begin();
it != dock_container_->children().end(); ++it) {
- if (!IsUsedByLayout(*it) ||
+ if (!IsWindowDocked(*it) ||
((*it) == dragged_window_ && !is_dragged_window_docked_)) {
continue;
}
« no previous file with comments | « no previous file | ash/wm/dock/docked_window_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698