Commit d7fec8f4 authored by sadrul@chromium.org's avatar sadrul@chromium.org

aura: Fix the sythentic mouse-event location.

The synthetic mouse event is generated at the last mouse DIP-location. But this
event gets transformed for DIP again before it gets dispatched. This ends up
sending the event with incorrect location. So make sure it starts off with the
pixel-location so that the event location gets transformed for DIP only once.

BUG=128095
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10408037

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138104 0039d316-1c4b-4281-b951-d872f2087c98
parent 741b2016
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "ui/compositor/layer.h" #include "ui/compositor/layer.h"
#include "ui/compositor/layer_animator.h" #include "ui/compositor/layer_animator.h"
#include "ui/gfx/monitor.h" #include "ui/gfx/monitor.h"
#include "ui/gfx/point3.h"
#include "ui/gfx/screen.h" #include "ui/gfx/screen.h"
using std::vector; using std::vector;
...@@ -1003,8 +1004,12 @@ void RootWindow::SynthesizeMouseMoveEvent() { ...@@ -1003,8 +1004,12 @@ void RootWindow::SynthesizeMouseMoveEvent() {
synthesize_mouse_move_ = false; synthesize_mouse_move_ = false;
#if !defined(OS_WIN) #if !defined(OS_WIN)
// Temporarily disabled for windows. See crbug.com/112222. // Temporarily disabled for windows. See crbug.com/112222.
gfx::Point orig_mouse_location = last_mouse_location_; gfx::Point3f point(last_mouse_location_);
layer()->transform().TransformPoint(orig_mouse_location); ui::Transform transform = layer()->transform();
float scale = ui::GetDeviceScaleFactor(layer());
transform.ConcatScale(scale, scale);
transform.TransformPoint(point);
gfx::Point orig_mouse_location = point.AsPoint();
// TODO(derat|oshima): Don't use mouse_button_flags_ as it's // TODO(derat|oshima): Don't use mouse_button_flags_ as it's
// currently broken. See/ crbug.com/107931. // currently broken. See/ crbug.com/107931.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment