| Index: ash/host/ash_window_tree_host_ozone.cc
|
| diff --git a/ash/host/ash_window_tree_host_ozone.cc b/ash/host/ash_window_tree_host_ozone.cc
|
| index 6b24015d06442d2060690eb0bd319db39b282f9f..7b0dd1d240bae208db66156acebb5fa5d852f828 100644
|
| --- a/ash/host/ash_window_tree_host_ozone.cc
|
| +++ b/ash/host/ash_window_tree_host_ozone.cc
|
| @@ -8,6 +8,7 @@
|
| #include "ash/host/root_window_transformer.h"
|
| #include "ash/host/transformer_helper.h"
|
| #include "base/command_line.h"
|
| +#include "ui/aura/client/screen_position_client.h"
|
| #include "ui/aura/window_tree_host_ozone.h"
|
| #include "ui/gfx/geometry/insets.h"
|
| #include "ui/gfx/transform.h"
|
| @@ -21,6 +22,9 @@ class AshWindowTreeHostOzone : public AshWindowTreeHost,
|
| explicit AshWindowTreeHostOzone(const gfx::Rect& initial_bounds);
|
| virtual ~AshWindowTreeHostOzone();
|
|
|
| + protected:
|
| + void TranslateLocatedEvent(ui::LocatedEvent* event) OVERRIDE;
|
| +
|
| private:
|
| // AshWindowTreeHost:
|
| virtual void ToggleFullScreen() OVERRIDE;
|
| @@ -87,6 +91,30 @@ void AshWindowTreeHostOzone::UpdateRootWindowSize(const gfx::Size& host_size) {
|
| transformer_helper_.UpdateWindowSize(host_size);
|
| }
|
|
|
| +void AshWindowTreeHostOzone::TranslateLocatedEvent(ui::LocatedEvent* event) {
|
| + if (!event->IsTouchEvent()) {
|
| + aura::Window* root_window = window();
|
| + aura::client::ScreenPositionClient* screen_position_client =
|
| + aura::client::GetScreenPositionClient(root_window);
|
| + gfx::Rect local(bounds().size());
|
| +
|
| + local.Inset(transformer_helper_.GetHostInsets());
|
| +
|
| + if (screen_position_client && !local.Contains(event->location())) {
|
| + gfx::Point location(event->location());
|
| + // In order to get the correct point in screen coordinates
|
| + // during passive grab, we first need to find on which host window
|
| + // the mouse is on, and find out the screen coordinates on that
|
| + // host window, then convert it back to this host window's coordinate.
|
| + screen_position_client->ConvertHostPointToScreen(root_window, &location);
|
| + screen_position_client->ConvertPointFromScreen(root_window, &location);
|
| + ConvertPointToHost(&location);
|
| + event->set_location(location);
|
| + event->set_root_location(location);
|
| + }
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|
| AshWindowTreeHost* AshWindowTreeHost::Create(
|
|
|