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

Unified Diff: remoting/host/input_injector_linux.cc

Issue 23484015: Added support of relative mouse motion in Chromoting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 7 years, 3 months 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_linux.cc
diff --git a/remoting/host/input_injector_linux.cc b/remoting/host/input_injector_linux.cc
index cbb807bdc3a65aaed001f500244caaff0bc85517..d61d8f2072441dab7370ec31156969f659bd594a 100644
--- a/remoting/host/input_injector_linux.cc
+++ b/remoting/host/input_injector_linux.cc
@@ -299,7 +299,16 @@ void InputInjectorLinux::Core::InjectMouseEvent(const MouseEvent& event) {
return;
}
- if (event.has_x() && event.has_y()) {
+ if (event.has_delta_x() &&
+ event.has_delta_y() &&
+ (event.delta_x() != 0 || event.delta_y() != 0)) {
+ latest_mouse_position_ = SkIPoint::Make(-1, -1);
+ VLOG(3) << "Moving mouse by " << event.delta_x() << "," << event.delta_y();
+ XTestFakeRelativeMotionEvent(display_,
+ event.delta_x(), event.delta_y(),
+ CurrentTime);
+
+ } else if (event.has_x() && event.has_y()) {
// Injecting a motion event immediately before a button release results in
// a MotionNotify even if the mouse position hasn't changed, which confuses
// apps which assume MotionNotify implies movement. See crbug.com/138075.

Powered by Google App Engine
This is Rietveld 408576698