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

Unified Diff: remoting/host/input_injector_x11.cc

Issue 756643006: Remote assistance on Chrome OS Part IX - Input injection on Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Ozone_input_injection
Patch Set: Address wez's feedback Created 6 years 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: remoting/host/input_injector_x11.cc
diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc
index 3b5d2b46922014716fd862676de4a6c3f9c6ebd2..2b1b76eaced6188cdd3994d27b69a7c1e7f54bf7 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/pixel_rotator.h"
+#endif
#include "remoting/host/clipboard.h"
#include "remoting/host/linux/unicode_to_keysym.h"
#include "remoting/proto/internal.pb.h"
@@ -171,6 +174,10 @@ class InputInjectorX11 : public InputInjector {
int pointer_button_map_[kNumPointerButtons];
+#if defined(OS_CHROMEOS)
+ PixelRotator pixel_rotator_;
+#endif
+
scoped_ptr<Clipboard> clipboard_;
bool saved_auto_repeat_enabled_;
@@ -401,8 +408,15 @@ 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)
+ // Interim hack to handle display rotation on Chrome OS.
+ // TODO(kelvin): Remove this when Chrome OS has completely migrated to
+ // Ozone (crbug.com/439287).
+ gfx::PointF screen_location =
+ pixel_rotator_.ToScreenPixel(gfx::PointF(event.x(), event.y()));
+ new_mouse_position.set(screen_location.x(), screen_location.y());
+#endif
if (event.has_button() && event.has_button_down() && !event.button_down()) {
if (new_mouse_position.equals(latest_mouse_position_))
inject_motion = false;

Powered by Google App Engine
This is Rietveld 408576698