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

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: 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..53d13c5872f99923d2f19f1477e019a0f6ef0e4f 100644
--- a/remoting/host/input_injector_linux.cc
+++ b/remoting/host/input_injector_linux.cc
@@ -299,7 +299,14 @@ void InputInjectorLinux::Core::InjectMouseEvent(const MouseEvent& event) {
return;
}
- if (event.has_x() && event.has_y()) {
+ if (event.has_delta_x() && event.has_delta_y()) {
+ latest_mouse_position_ = SkIPoint::Make(-1, -1);
+ VLOG(3) << "Moving mouse by " << event.delta_x() << "," << event.delta_y();
+ XTestFakeRelativeMotionEvent(display_, DefaultScreen(display_),
+ event.delta_x(), event.delta_y(),
+ CurrentTime);
Wez 2013/09/05 20:24:45 nit: Filter out 0x0 movement?
alexeypa (please no reviews) 2013/09/06 20:00:17 Done.
+
+ } 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