Index: ui/aura/root_window.cc |
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc |
index e706ef0a2be1c15c16b0ff5260ff5a5442d1bc92..83d129e069f36962117d0b116121ec383b800775 100644 |
--- a/ui/aura/root_window.cc |
+++ b/ui/aura/root_window.cc |
@@ -40,6 +40,10 @@ |
#include "ui/gfx/screen.h" |
#include "ui/gfx/size_conversions.h" |
+#if defined(OS_CHROMEOS) |
Ben Goodger (Google)
2013/04/10 16:38:15
can you achieve this without this ifdef. it's unde
oshima
2013/04/10 17:03:04
see my comments below.
|
+#include "ui/base/events/event_utils.h" |
+#endif |
+ |
using std::vector; |
namespace aura { |
@@ -694,14 +698,20 @@ void RootWindow::TransformEventForDeviceScaleFactor(bool keep_inside_root, |
event->UpdateForRootTransform(GetInverseRootTransform()); |
#if defined(OS_CHROMEOS) |
Ben Goodger (Google)
2013/04/10 16:38:15
this ifdef is also undesirable. can we move this s
oshima
2013/04/10 17:03:04
This will be removed pretty soon (https://coderevi
|
const gfx::Rect& root_bounds = bounds(); |
+ if (!event->native_event()) |
+ return; |
+ const gfx::Point system_location = |
+ ui::EventSystemLocationFromNative(event->native_event()); |
if (keep_inside_root & |
- host_->GetBounds().Contains(event->system_location()) && |
+ host_->GetBounds().Contains(system_location) && |
!root_bounds.Contains(event->root_location())) { |
// Make sure that the mouse location inside the host window gets |
// translated inside root window. |
// TODO(oshima): This is (hopefully) short term bandaid to deal |
// with calculation error due to the fact that we rotate in dip |
// coordinates instead of pixels. crbug.com/222483. |
+ // When removing this, don't forget to remove the include of the |
+ // event_util.h file. |
int x = event->location().x(); |
int y = event->location().y(); |
x = std::min(std::max(x, root_bounds.x()), root_bounds.right()); |
@@ -1168,8 +1178,6 @@ void RootWindow::SynthesizeMouseMoveEvent() { |
host_mouse_location, |
host_mouse_location, |
ui::EF_IS_SYNTHESIZED); |
- ConvertPointToNativeScreen(&root_mouse_location); |
- event.set_system_location(root_mouse_location); |
OnHostMouseEvent(&event); |
} |