Bug 1244546 part 1 - Apply proper unit conversion for SynthesizeNativeMouseEvent. r=karlt
authorXidorn Quan <quanxunzhen@gmail.com>
Fri, 11 Mar 2016 19:10:44 +0800
changeset 288267 560ae259d391cd537ca004cbc0c3caebcc6223fb
parent 288266 3667b972ff4594c6cacc843f61b7cbc8c86ee094
child 288268 04ba63cdb181cf7efba193c1455e3ab506a699cc
push id30079
push userryanvm@gmail.com
push dateSat, 12 Mar 2016 20:24:19 +0000
treeherdermozilla-central@d1d47ba19ce9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1244546
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1244546 part 1 - Apply proper unit conversion for SynthesizeNativeMouseEvent. r=karlt MozReview-Commit-ID: 6XLzx7CyFEj
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -6818,17 +6818,18 @@ nsWindow::SynthesizeNativeMouseEvent(Lay
 #endif
 
     gdk_event_put(&event);
   } else {
     // We don't support specific events other than button-release. In case
     // aNativeMessage != GDK_BUTTON_RELEASE we'll synthesize a motion event
     // that will be emitted by gdk_display_warp_pointer().
     GdkScreen* screen = gdk_window_get_screen(mGdkWindow);
-    gdk_display_warp_pointer(display, screen, aPoint.x, aPoint.y);
+    GdkPoint point = DevicePixelsToGdkPointRoundDown(aPoint);
+    gdk_display_warp_pointer(display, screen, point.x, point.y);
   }
 
   return NS_OK;
 }
 
 nsresult
 nsWindow::SynthesizeNativeMouseScrollEvent(mozilla::LayoutDeviceIntPoint aPoint,
                                            uint32_t aNativeMessage,