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

Unified Diff: components/exo/shell_surface.cc

Issue 1874933002: exo: Further improve ignored-by-shelf test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 4f9ebb4cc30bb7255be0ae8d3904db0aee9ec7d8..7a19f872860773b78757c243c42316db53ed5650 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -379,22 +379,28 @@ void ShellSurface::OnSurfaceCommit() {
UpdateWidgetBounds();
gfx::Point surface_origin = GetSurfaceOrigin();
- gfx::Rect hit_test_bounds =
- surface_->GetHitTestBounds() + surface_origin.OffsetFromOrigin();
-
- // Only allow the shelf to recognize this window if the hit-test bounds
- // contains the widget bounds. This prevents shaped windows that might
- // only occupy a small area of the widget from dimming the shelf when
- // maximized.
- bool ignored_by_shelf = !hit_test_bounds.Contains(
- gfx::Rect(widget_->GetNativeWindow()->bounds().size()));
-
- // Update state and shelf visibility if |ignored_by_shelf| changed.
- ash::wm::WindowState* window_state =
- ash::wm::GetWindowState(widget_->GetNativeWindow());
- if (ignored_by_shelf != window_state->ignored_by_shelf()) {
- window_state->set_ignored_by_shelf(ignored_by_shelf);
- ash::Shell::GetInstance()->UpdateShelfVisibility();
+
+ // Determine if window should be ignored by shelf if all configure requests
+ // have been acknowledged.
+ if (pending_configs_.empty()) {
+ gfx::Rect hit_test_bounds =
+ surface_->GetHitTestBounds() + surface_origin.OffsetFromOrigin();
+
+ // When maximized, only allow the shelf to recognize this window if the
+ // hit-test bounds contains the widget bounds. This prevents shaped
+ // windows that might only occupy a small area of the widget from dimming
+ // the shelf when maximized.
+ bool ignored_by_shelf = widget_->IsMaximized() &&
+ !hit_test_bounds.Contains(gfx::Rect(
+ widget_->GetNativeWindow()->bounds().size()));
+
+ // Update state and shelf visibility if |ignored_by_shelf| changed.
+ ash::wm::WindowState* window_state =
+ ash::wm::GetWindowState(widget_->GetNativeWindow());
+ if (ignored_by_shelf != window_state->ignored_by_shelf()) {
+ window_state->set_ignored_by_shelf(ignored_by_shelf);
+ ash::Shell::GetInstance()->UpdateShelfVisibility();
+ }
}
// Update surface bounds.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698