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

Unified Diff: components/exo/shell_surface.cc

Issue 2827233002: Revert of Do not hide shadow underlay for max/fullscreen state even if the client disables the ... (Closed)
Patch Set: Rebased due to a merge conflict (not very trivial). Created 3 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 | components/exo/shell_surface_unittest.cc » ('j') | 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 1535bac087c9561f9079fbeb6d3117872854a161..6687ddd47186c2e821a32b06ca479c831c114a73 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -1558,15 +1558,7 @@ void ShellSurface::UpdateShadow() {
if (!widget_ || !surface_)
return;
aura::Window* window = widget_->GetNativeWindow();
-
- bool underlay_capture_events =
- WMHelper::GetInstance()->IsSpokenFeedbackEnabled() && widget_->IsActive();
- bool black_background_enabled =
- ((widget_->IsFullscreen() || widget_->IsMaximized()) ||
- underlay_capture_events) &&
- ash::wm::GetWindowState(window)->allow_set_bounds_direct() &&
- window->layer()->GetTargetTransform().IsIdentity();
- if (!shadow_enabled_ && !black_background_enabled) {
+ if (!shadow_enabled_) {
wm::SetShadowElevation(window, wm::ShadowElevation::NONE);
if (shadow_underlay_)
shadow_underlay_->Hide();
@@ -1634,6 +1626,10 @@ void ShellSurface::UpdateShadow() {
}
}
+ bool underlay_capture_events =
+ WMHelper::GetInstance()->IsSpokenFeedbackEnabled() &&
+ widget_->IsActive();
+
float shadow_underlay_opacity = shadow_background_opacity_;
// Put the black background layer behind the window if
@@ -1643,7 +1639,10 @@ void ShellSurface::UpdateShadow() {
// thus the background can be visible).
// 3) the window has no transform (the transformed background may
// not cover the entire background, e.g. overview mode).
- if (black_background_enabled) {
+ if ((widget_->IsFullscreen() || widget_->IsMaximized() ||
+ underlay_capture_events) &&
+ ash::wm::GetWindowState(window)->allow_set_bounds_direct() &&
+ window->layer()->GetTargetTransform().IsIdentity()) {
if (shadow_underlay_in_surface_) {
shadow_underlay_bounds = gfx::Rect(surface_->window()->bounds().size());
} else {
@@ -1658,8 +1657,6 @@ void ShellSurface::UpdateShadow() {
if (!shadow_underlay_in_surface_)
shadow_underlay_bounds = shadow_bounds;
- shadow_underlay_->SetBounds(shadow_underlay_bounds);
-
// Constrain the underlay bounds to the client area in case shell surface
// frame is enabled.
if (frame_enabled_) {
@@ -1667,6 +1664,8 @@ void ShellSurface::UpdateShadow() {
widget_->non_client_view()->frame_view()->GetBoundsForClientView());
}
+ shadow_underlay_->SetBounds(shadow_underlay_bounds);
+
shadow_underlay_->Show();
// TODO(oshima): Setting to the same value should be no-op.
« no previous file with comments | « no previous file | components/exo/shell_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698