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) { |