Bug 833663 - Set MOZ_SOURCE_TOUCH for simulated mouse events in Gonk [r=cjones]
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 24 Jan 2013 06:53:39 -0800
changeset 119881 d55997bd0019118b7727bbe6ad2dc0052cfcf2ab
parent 119880 cb038730d5f1ad2a19e2c9c1946f6d766f97012b
child 119882 2692ef57acaa37971bfd885139969d9d6a22800b
push id24231
push userryanvm@gmail.com
push dateSun, 27 Jan 2013 00:13:14 +0000
treeherdermozilla-central@d802d6faa080 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs833663
milestone21.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 833663 - Set MOZ_SOURCE_TOUCH for simulated mouse events in Gonk [r=cjones]
dom/ipc/TabChild.cpp
widget/gonk/nsAppShell.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1373,16 +1373,17 @@ TabChild::DispatchSynthesizedMouseEvent(
   MOZ_ASSERT(aMsg == NS_MOUSE_MOVE || aMsg == NS_MOUSE_BUTTON_DOWN ||
              aMsg == NS_MOUSE_BUTTON_UP);
 
   nsMouseEvent event(true, aMsg, NULL,
       nsMouseEvent::eReal, nsMouseEvent::eNormal);
   event.refPoint = aRefPoint;
   event.time = aTime;
   event.button = nsMouseEvent::eLeftButton;
+  event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
   if (aMsg != NS_MOUSE_MOVE) {
     event.clickCount = 1;
   }
 
   DispatchWidgetEvent(event);
 }
 
 static nsDOMTouch*
--- a/widget/gonk/nsAppShell.cpp
+++ b/widget/gonk/nsAppShell.cpp
@@ -130,16 +130,17 @@ sendMouseEvent(uint32_t msg, uint64_t ti
 {
     nsMouseEvent event(true, msg, NULL,
                        nsMouseEvent::eReal, nsMouseEvent::eNormal);
 
     event.refPoint.x = x;
     event.refPoint.y = y;
     event.time = timeMs;
     event.button = nsMouseEvent::eLeftButton;
+    event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
     if (msg != NS_MOUSE_MOVE)
         event.clickCount = 1;
 
     event.mFlags.mNoCrossProcessBoundaryForwarding = !forwardToChildren;
 
     nsWindow::DispatchInputEvent(event);
 }