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

Unified Diff: ash/wm/workspace/workspace_animations.cc

Issue 11280188: Fix focus loss on partial lock. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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 | ui/compositor/layer_animator.h » ('j') | ui/compositor/layer_animator.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_animations.cc
diff --git a/ash/wm/workspace/workspace_animations.cc b/ash/wm/workspace/workspace_animations.cc
index 2bffbd57503ef29c359f9ecf3522f64f60bf86bc..96c7c1da8c74b2fd44e335b3c1036fa8effe0261 100644
--- a/ash/wm/workspace/workspace_animations.cc
+++ b/ash/wm/workspace/workspace_animations.cc
@@ -49,6 +49,13 @@ base::TimeDelta DurationForWorkspaceShowOrHide(
details.duration;
}
+void HideWindow(aura::Window* window) {
+ ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
+ settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
+ settings.SetTransitionDuration(base::TimeDelta());
+ window->Hide();
+}
+
} // namespace
WorkspaceAnimationDetails::WorkspaceAnimationDetails()
@@ -140,20 +147,25 @@ void HideWorkspace(aura::Window* window,
window->layer()->SetTransform(gfx::Transform());
}
- // NOTE: Hide() must be before SetOpacity(), else
- // VisibilityController::UpdateLayerVisibility doesn't pass the false to the
- // layer so that the layer and window end up out of sync and confused.
- window->Hide();
+ window->layer()->SetVisible(false);
if (details.animate_opacity)
window->layer()->SetOpacity(0.0f);
+ base::Closure hide_window_callback = base::Bind(&HideWindow, window);
Daniel Erat 2012/11/27 18:32:11 add a comment describing why you're doing this
Denis Kuznetsov (DE-MUC) 2012/11/27 18:46:59 Done.
+ window->layer()->GetAnimator()->ScheduleSuccessCallbackForProperties(
+ hide_window_callback,
+ ui::LayerAnimationElement::VISIBILITY,
+ -1
+ );
+
// After the animation completes snap the transform back to the identity,
// otherwise any one that asks for screen bounds gets a slightly scaled
// version.
settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
settings.SetTransitionDuration(base::TimeDelta());
window->layer()->SetTransform(gfx::Transform());
+
Daniel Erat 2012/11/27 18:32:11 nit: remove extra blank line
Denis Kuznetsov (DE-MUC) 2012/11/27 18:46:59 Done.
}
} // namespace internal
« no previous file with comments | « no previous file | ui/compositor/layer_animator.h » ('j') | ui/compositor/layer_animator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698