| Index: ash/wm/frame_painter.cc
|
| ===================================================================
|
| --- ash/wm/frame_painter.cc (revision 133684)
|
| +++ ash/wm/frame_painter.cc (working copy)
|
| @@ -112,8 +112,10 @@
|
|
|
| // Returns true if |window| is a visible, normal window.
|
| bool IsVisibleNormalWindow(aura::Window* window) {
|
| + // We must use TargetVisibility() because windows animate in and out and
|
| + // IsVisible() also tracks the layer visibility state.
|
| return window &&
|
| - window->IsVisible() &&
|
| + window->TargetVisibility() &&
|
| window->type() == aura::client::WINDOW_TYPE_NORMAL;
|
| }
|
|
|
| @@ -463,6 +465,14 @@
|
| }
|
| }
|
|
|
| +void FramePainter::OnWindowVisibilityChanged(aura::Window* window,
|
| + bool visible) {
|
| + // Hiding a window may trigger the solo window appearance in a different
|
| + // window.
|
| + if (!visible && UseSoloWindowHeader())
|
| + SchedulePaintForSoloWindow();
|
| +}
|
| +
|
| void FramePainter::OnWindowDestroying(aura::Window* destroying) {
|
| DCHECK_EQ(window_, destroying);
|
| // Must be removed here and not in the destructor, as the aura::Window is
|
| @@ -474,17 +484,9 @@
|
| instances_->erase(this);
|
|
|
| // If we have two or more windows open and we close this one, we might trigger
|
| - // the solo window appearance. If so, find the window that is becoming solo
|
| - // and schedule it to paint.
|
| - if (UseSoloWindowHeader()) {
|
| - for (std::set<FramePainter*>::const_iterator it = instances_->begin();
|
| - it != instances_->end();
|
| - ++it) {
|
| - FramePainter* painter = *it;
|
| - if (IsVisibleNormalWindow(painter->window_) && painter->frame_)
|
| - painter->frame_->non_client_view()->SchedulePaint();
|
| - }
|
| - }
|
| + // the solo window appearance for another window.
|
| + if (UseSoloWindowHeader())
|
| + SchedulePaintForSoloWindow();
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| @@ -524,4 +526,15 @@
|
| return window_count == 1;
|
| }
|
|
|
| +// static
|
| +void FramePainter::SchedulePaintForSoloWindow() {
|
| + for (std::set<FramePainter*>::const_iterator it = instances_->begin();
|
| + it != instances_->end();
|
| + ++it) {
|
| + FramePainter* painter = *it;
|
| + if (IsVisibleNormalWindow(painter->window_))
|
| + painter->frame_->non_client_view()->SchedulePaint();
|
| + }
|
| +}
|
| +
|
| } // namespace ash
|
|
|