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

Unified Diff: ui/aura/event.cc

Issue 10381063: Aura/ash split: Don't use X11 window borders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Commnet that we're racing the window manager. Created 8 years, 7 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
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)

Powered by Google App Engine
This is Rietveld 408576698