Index: athena/wm/split_view_controller.cc |
diff --git a/athena/wm/split_view_controller.cc b/athena/wm/split_view_controller.cc |
index 1d61ba7d957e77f938fea6d216563401875f2e1b..5974cf1357c83791f4cf3723ebd1ec6abe777201 100644 |
--- a/athena/wm/split_view_controller.cc |
+++ b/athena/wm/split_view_controller.cc |
@@ -65,14 +65,9 @@ void SplitViewController::ActivateSplitMode(aura::Window* left, |
aura::Window::Windows windows = window_list_provider_->GetWindowList(); |
aura::Window::Windows::reverse_iterator iter = windows.rbegin(); |
if (state_ == ACTIVE) { |
- if (left_window_ == right) |
- left_window_ = left; |
- if (right_window_ == left) |
- right_window_ = right; |
- |
- if (!left) |
+ if (!left && left_window_ != right) |
left = left_window_; |
- if (!right) |
+ if (!right && right_window_ != left) |
right = right_window_; |
} |
@@ -94,6 +89,12 @@ void SplitViewController::ActivateSplitMode(aura::Window* left, |
} |
} |
+ to_hide_.clear(); |
+ if (left_window_ && left_window_ != left && left_window_ != right) |
+ to_hide_.push_back(left_window_); |
+ if (right_window_ && right_window_ != left && right_window_ != right) |
+ to_hide_.push_back(right_window_); |
+ |
SetState(ACTIVE); |
right_window_ = right; |
left_window_ = left; |
@@ -155,16 +156,20 @@ void SplitViewController::UpdateLayout(bool animate) { |
CHECK(left_window_); |
CHECK(right_window_); |
- // Splitview can be activated from SplitViewController::ActivateSplitMode or |
- // SplitViewController::ScrollEnd. Additionally we don't want to rotate the |
- // screen while engaging splitview (i.e. state_ == SCROLLING). |
- if (state_ == INACTIVE && !animate) { |
- if (!wm::IsActiveWindow(left_window_)) |
- left_window_->Hide(); |
- if (!wm::IsActiveWindow(right_window_)) |
- right_window_->Hide(); |
- SetWindowTransforms(gfx::Transform(), gfx::Transform(), false); |
- return; |
+ if (!animate) { |
+ for (size_t i = 0; i < to_hide_.size(); ++i) |
+ to_hide_[i]->Hide(); |
+ to_hide_.clear(); |
+ |
+ if (state_ == INACTIVE) { |
+ if (!wm::IsActiveWindow(left_window_)) |
+ left_window_->Hide(); |
+ if (!wm::IsActiveWindow(right_window_)) |
+ right_window_->Hide(); |
+ |
+ SetWindowTransforms(gfx::Transform(), gfx::Transform(), false); |
+ return; |
+ } |
sadrul
2014/09/15 21:01:21
It's difficult to reason why this is here. OnAnima
mfomitchev
2014/09/15 22:18:34
I agree. On a related note, I think it would be ni
|
} |
left_window_->Show(); |