OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/host/ash_window_tree_host_x11.h" | 5 #include "ash/host/ash_window_tree_host_x11.h" |
6 | 6 |
7 #include <X11/extensions/Xfixes.h> | 7 #include <X11/extensions/Xfixes.h> |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 touch_calibrate_->Calibrate(touchev, bounds()); | 333 touch_calibrate_->Calibrate(touchev, bounds()); |
334 #endif // defined(USE_XI2_MT) | 334 #endif // defined(USE_XI2_MT) |
335 } | 335 } |
336 break; | 336 break; |
337 } | 337 } |
338 default: { | 338 default: { |
339 aura::Window* root_window = window(); | 339 aura::Window* root_window = window(); |
340 aura::client::ScreenPositionClient* screen_position_client = | 340 aura::client::ScreenPositionClient* screen_position_client = |
341 aura::client::GetScreenPositionClient(root_window); | 341 aura::client::GetScreenPositionClient(root_window); |
342 gfx::Rect local(bounds().size()); | 342 gfx::Rect local(bounds().size()); |
343 | 343 local.Inset(transformer_helper_.GetHostInsets()); |
344 if (screen_position_client && !local.Contains(event->location())) { | 344 if (screen_position_client && !local.Contains(event->location())) { |
345 gfx::Point location(event->location()); | 345 gfx::Point location(event->location()); |
346 // In order to get the correct point in screen coordinates | 346 // In order to get the correct point in screen coordinates |
347 // during passive grab, we first need to find on which host window | 347 // during passive grab, we first need to find on which host window |
348 // the mouse is on, and find out the screen coordinates on that | 348 // the mouse is on, and find out the screen coordinates on that |
349 // host window, then convert it back to this host window's coordinate. | 349 // host window, then convert it back to this host window's coordinate. |
350 screen_position_client->ConvertHostPointToScreen(root_window, | 350 screen_position_client->ConvertHostPointToScreen(root_window, |
351 &location); | 351 &location); |
352 screen_position_client->ConvertPointFromScreen(root_window, &location); | 352 screen_position_client->ConvertPointFromScreen(root_window, &location); |
353 ConvertPointToHost(&location); | 353 ConvertPointToHost(&location); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 1); | 409 1); |
410 } | 410 } |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 AshWindowTreeHost* AshWindowTreeHost::Create(const gfx::Rect& initial_bounds) { | 414 AshWindowTreeHost* AshWindowTreeHost::Create(const gfx::Rect& initial_bounds) { |
415 return new AshWindowTreeHostX11(initial_bounds); | 415 return new AshWindowTreeHostX11(initial_bounds); |
416 } | 416 } |
417 | 417 |
418 } // namespace ash | 418 } // namespace ash |
OLD | NEW |