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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 280383009: Fixing invalid window opacity/visibility combination with the shelf (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 9df4bdc791d25f11f9376ac5e6bf0b96c04ba687..dcb1b9ae6e3acc81e99da53fde3f2a02e2eebf04 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -723,6 +723,15 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity(
GetLayer(shelf_->status_area_widget())->SetOpacity(
target_bounds.status_opacity);
+
+ // Having a window which is visible but does not have an opacity is an illegal
+ // state. We therefore show / hide the shelf here if required.
+ bool visible = shelf_->status_area_widget()->IsVisible();
+ if (visible && !target_bounds.status_opacity)
sky 2014/05/13 21:43:07 Do you really care about the current visibility?
Mr4D (OOO till 08-26) 2014/05/13 22:08:17 Was only trying to avoid duplicate calls. But sinc
+ shelf_->status_area_widget()->Hide();
+ else if (!visible && target_bounds.status_opacity)
+ shelf_->status_area_widget()->Show();
+
// TODO(harrym): Once status area widget is a child view of shelf
// this can be simplified.
gfx::Rect status_bounds = target_bounds.status_bounds_in_shelf;
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ui/aura/window.cc » ('j') | ui/aura/window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698