Chromium Code Reviews| Index: ui/aura/event.cc |
| diff --git a/ui/aura/event.cc b/ui/aura/event.cc |
| index 8a3bab0f7842004b6908a5f81e18ead4fa3dfa8f..679e205b01f6228fa4957e657a182abd2632edce 100644 |
| --- a/ui/aura/event.cc |
| +++ b/ui/aura/event.cc |
| @@ -100,7 +100,7 @@ LocatedEvent::LocatedEvent(const base::NativeEvent& native_event) |
| ui::EventTypeFromNative(native_event), |
| ui::EventFlagsFromNative(native_event)), |
| location_(ui::EventLocationFromNative(native_event)), |
| - root_location_(location_) { |
| + root_location_(ui::EventRootLocationFromNative(native_event)) { |
|
sadrul
2012/05/10 13:34:10
This might be tricky; I think 'root_location_' is
|
| } |
| LocatedEvent::LocatedEvent(const LocatedEvent& model, |
| @@ -124,11 +124,17 @@ LocatedEvent::LocatedEvent(ui::EventType type, |
| void LocatedEvent::UpdateForRootTransform(const ui::Transform& root_transform) { |
| // Transform has to be done at root level. |
| - DCHECK_EQ(root_location_.x(), location_.x()); |
| - DCHECK_EQ(root_location_.y(), location_.y()); |
| - gfx::Point3f p(location_); |
| - root_transform.TransformPointReverse(p); |
| - root_location_ = location_ = p.AsPoint(); |
| + if (!root_transform.matrix().isIdentity()) { |
| + // TODO(oshima): This isn't correct in any environment that isn't ash. It |
| + // assumes that the all locations are root relative which is only true in |
| + // ash. This is only true in real desktop environments when our window is |
| + // sitting at the root origin. |
| + DCHECK_EQ(root_location_.x(), location_.x()); |
| + DCHECK_EQ(root_location_.y(), location_.y()); |
| + gfx::Point3f p(location_); |
| + root_transform.TransformPointReverse(p); |
| + root_location_ = location_ = p.AsPoint(); |
| + } |
| } |
| MouseEvent::MouseEvent(const base::NativeEvent& native_event) |