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

Unified Diff: ash/wm/overview/window_overview.cc

Issue 196723009: Not submitted - Fixing invalid visibility states with layers which showed up in unittests ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/overview/window_selector_panels.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/window_overview.cc
diff --git a/ash/wm/overview/window_overview.cc b/ash/wm/overview/window_overview.cc
index 34d4dc4f194457d0ae635f739780f1d204db40d3..399117ee6986648cb9ab83a67021133648085e7b 100644
--- a/ash/wm/overview/window_overview.cc
+++ b/ash/wm/overview/window_overview.cc
@@ -49,6 +49,10 @@ const int kOverviewSelectorTransitionMilliseconds = 100;
// The color and opacity of the overview selector.
const SkColor kWindowOverviewSelectionColor = SK_ColorBLACK;
const float kWindowOverviewSelectionOpacity = 0.5f;
+// When a window layer gets hidden, and the window remains "logically visible",
+// it is illegal to fade the layer to 0. We therefore use a fraction which is
+// resolving to an alpha of 0 but tells a comparison otherwise.
+const float kWindowLayerNotShown = 0.001f;
sky 2014/03/12 19:31:40 Ugh. Why can't you actually hide here and evervy w
// The padding or amount of the window selector widget visible around the edges
// of the currently selected window.
@@ -217,7 +221,7 @@ void WindowOverview::SetSelection(size_t index) {
old_selection->SetBoundsInScreen(
GetSelectionBounds(selection_index_) + fade_out_direction,
dst_display);
- old_selection->layer()->SetOpacity(0);
+ old_selection->layer()->SetOpacity(kWindowLayerNotShown);
InitializeSelectionWidget();
selection_widget_->GetNativeWindow()->SetBoundsInScreen(
target_bounds - fade_out_direction, dst_display);
@@ -353,7 +357,7 @@ void WindowOverview::HideAndTrackNonOverviewWindows() {
// Hiding the window can result in it being destroyed.
if (!hidden_windows_.Contains(*iter))
continue;
- (*iter)->layer()->SetOpacity(0);
+ (*iter)->layer()->SetOpacity(kWindowLayerNotShown);
}
}
@@ -447,7 +451,8 @@ void WindowOverview::InitializeSelectionWidget() {
selection_widget_->Show();
selection_widget_->GetNativeWindow()->parent()->StackChildAtBottom(
selection_widget_->GetNativeWindow());
- selection_widget_->GetNativeWindow()->layer()->SetOpacity(0);
+ selection_widget_->GetNativeWindow()->layer()->SetOpacity(
+ kWindowLayerNotShown);
}
gfx::Rect WindowOverview::GetSelectionBounds(size_t index) {
« no previous file with comments | « no previous file | ash/wm/overview/window_selector_panels.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698