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

Unified Diff: ash/wm/frame_painter.cc

Issue 10206021: Merge 133595 - ash: Fix transparency glitches in window header (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 8 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/frame_painter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/wm/frame_painter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698