Bug 1272152 - Convert LayoutDevice coordinates to GDK coordinates before sending them to GDK. r=karlt

MozReview-Commit-ID: BuFDHnqVsRD

--HG--
extra : rebase_source : fdae1dde3c5bc9ed33f67d60f2d74b0a2732f04b
This commit is contained in:
Kartikaya Gupta 2016-05-11 17:57:43 -04:00
parent 5bd0507354
commit 346748ccf1

View File

@ -6870,12 +6870,12 @@ nsWindow::SynthesizeNativeMouseScrollEvent(mozilla::LayoutDeviceIntPoint aPoint,
GdkDeviceManager *device_manager = gdk_display_get_device_manager(display);
event.scroll.device = gdk_device_manager_get_client_pointer(device_manager);
#endif
event.scroll.x_root = aPoint.x;
event.scroll.y_root = aPoint.y;
event.scroll.x_root = DevicePixelsToGdkCoordRoundDown(aPoint.x);
event.scroll.y_root = DevicePixelsToGdkCoordRoundDown(aPoint.y);
LayoutDeviceIntPoint pointInWindow = aPoint - WidgetToScreenOffset();
event.scroll.x = pointInWindow.x;
event.scroll.y = pointInWindow.y;
event.scroll.x = DevicePixelsToGdkCoordRoundDown(pointInWindow.x);
event.scroll.y = DevicePixelsToGdkCoordRoundDown(pointInWindow.y);
// The delta values are backwards on Linux compared to Windows and Cocoa,
// hence the negation.