Index: remoting/host/input_injector_x11.cc |
diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc |
index 3b5d2b46922014716fd862676de4a6c3f9c6ebd2..7c665eefa0b4bb756a332a8bb9c8d5b2f7b175d4 100644 |
--- a/remoting/host/input_injector_x11.cc |
+++ b/remoting/host/input_injector_x11.cc |
@@ -18,6 +18,9 @@ |
#include "base/single_thread_task_runner.h" |
#include "base/strings/utf_string_conversion_utils.h" |
#include "remoting/base/logging.h" |
+#if defined(OS_CHROMEOS) |
+#include "remoting/host/chromeos/display_transform_util.h" |
+#endif |
#include "remoting/host/clipboard.h" |
#include "remoting/host/linux/unicode_to_keysym.h" |
#include "remoting/proto/internal.pb.h" |
@@ -401,8 +404,18 @@ void InputInjectorX11::Core::InjectMouseEvent(const MouseEvent& event) { |
// a MotionNotify even if the mouse position hasn't changed, which confuses |
// apps which assume MotionNotify implies movement. See crbug.com/138075. |
bool inject_motion = true; |
- webrtc::DesktopVector new_mouse_position( |
- webrtc::DesktopVector(event.x(), event.y())); |
+ webrtc::DesktopVector new_mouse_position(event.x(), event.y()); |
+#if defined(OS_CHROMEOS) |
+ // When a physical display (1280 x 850) is rotated 90 degs (it is |
+ // effectively an 850 x 1280) display, Chromoting clients sends mouse events |
+ // in the rotated co-ordinates system (850 x 1280). However, ChromeOS |
+ // expects the raw events to match the native resolution. |
+ // Rotates the co-ordinates of the input events appropriately for the |
+ // current display rotation settings. |
+ gfx::PointF screen_location = |
+ ConvertPointToNativeScreen(gfx::PointF(event.x(), event.y())); |
+ new_mouse_position.set(screen_location.x(), screen_location.y()); |
Wez
2014/12/04 01:28:25
Can we do this rotation in the InputInjectorChrome
kelvinp
2014/12/05 03:17:28
This is going to be an interim hack, that will be
|
+#endif |
if (event.has_button() && event.has_button_down() && !event.button_down()) { |
if (new_mouse_position.equals(latest_mouse_position_)) |
inject_motion = false; |