From bec85dd5e7746b1ba5afeb4d6581006b18c8fe70 Mon Sep 17 00:00:00 2001 From: "skuhne@chromium.org" Date: Fri, 14 Jun 2013 18:26:44 +0000 Subject: Correct the jump list location for invocations while the launcher is animated into view. I thought of adding an observer and a special way to the menu class to be able to get and change the view bounds dynamically - but this highly unlikely case does somehow not justify the complexity increase. BUG=236211 TEST=visual: razor sharp perception clicking required ;) Review URL: https://chromiumcodereview.appspot.com/17034003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206456 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/launcher/launcher_view.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ash') diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc index 7269b8c..0d1f898 100644 --- a/ash/launcher/launcher_view.cc +++ b/ash/launcher/launcher_view.cc @@ -38,6 +38,7 @@ #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/gfx/canvas.h" +#include "ui/gfx/point.h" #include "ui/views/animation/bounds_animator.h" #include "ui/views/border.h" #include "ui/views/controls/button/image_button.h" @@ -1570,6 +1571,14 @@ void LauncherView::ShowMenu( ash::ShelfAlignment align = shelf->GetAlignment(); anchor_point = source->GetBoundsInScreen(); + // It is possible to invoke the menu while it is sliding into view. To cover + // that case, the screen coordinates are offsetted by the animation delta. + gfx::Vector2d offset = + source->GetWidget()->GetNativeWindow()->bounds().origin() - + source->GetWidget()->GetNativeWindow()->GetTargetBounds().origin(); + anchor_point.set_x(anchor_point.x() - offset.x()); + anchor_point.set_y(anchor_point.y() - offset.y()); + // Launcher items can have an asymmetrical border for spacing reasons. // Adjust anchor location for this. if (source->border()) -- cgit v1.1