Bug 1521630 [Linux/Gtk] Use GdkEventCoordsToDevicePixels() to get mouse coordinates for mDraggableRegion.Contains(), r=ntim,TYLin
authorMartin Stransky <stransky@redhat.com>
Thu, 24 Jan 2019 19:29:14 +0000
changeset 515330 b7d1b3bf0220d116d2c6624b46427994f06824fe
parent 515329 3f8aeb316a5ce9fd7aea4889eb2c361d6f262b88
child 515331 79a6318fcf3f579db5699a5ad449d5e607cffd5b
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersntim, TYLin
bugs1521630
milestone66.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 1521630 [Linux/Gtk] Use GdkEventCoordsToDevicePixels() to get mouse coordinates for mDraggableRegion.Contains(), r=ntim,TYLin Differential Revision: https://phabricator.services.mozilla.com/D17490
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -2566,17 +2566,19 @@ void nsWindow::OnButtonPressEvent(GdkEve
 
   WidgetMouseEvent event(true, eMouseDown, this, WidgetMouseEvent::eReal);
   event.button = domButton;
   InitButtonEvent(event, aEvent);
   event.pressure = mLastMotionPressure;
 
   nsEventStatus eventStatus = DispatchInputEvent(&event);
 
-  if (mDraggableRegion.Contains(aEvent->x, aEvent->y) &&
+  LayoutDeviceIntPoint refPoint =
+      GdkEventCoordsToDevicePixels(aEvent->x, aEvent->y);
+  if (mDraggableRegion.Contains(refPoint.x, refPoint.y) &&
       domButton == WidgetMouseEvent::eLeftButton &&
       eventStatus != nsEventStatus_eConsumeNoDefault) {
     mWindowShouldStartDragging = true;
   }
 
   // right menu click on linux should also pop up a context menu
   if (!nsBaseWidget::ShowContextMenuAfterMouseUp()) {
     DispatchContextMenuEventFromMouseEvent(domButton, aEvent);