Bug 1299707 - Disable XInput2 without MOZ_USE_USE_XINPUT2 on content process. r?acomminos draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 07 Oct 2016 12:24:56 +0900
changeset 421912 a0d271eabc10b5dbaac44d0f8aca0ab93cc5bf33
parent 421880 58286ce1d3d105ba3e441ddf1e65d8682cd1c52f
child 533204 a0ec449d2fd760bd6ce6deb60faf0ccf04d1b626
push id31635
push userm_kato@ga2.so-net.ne.jp
push dateFri, 07 Oct 2016 03:31:03 +0000
reviewersacomminos
bugs1299707
milestone52.0a1
Bug 1299707 - Disable XInput2 without MOZ_USE_USE_XINPUT2 on content process. r?acomminos Actually, we don't turn of xinput2 on content process. So, although chrome process cannot detect touch screen device, content process can detect it. So if we turn off xinput2 on chrome process, content process should be turned off. MozReview-Commit-ID: 1kfsDBpqhC1
toolkit/xre/nsEmbedFunctions.cpp
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -496,16 +496,24 @@ XRE_InitChildProcess(int aArgc,
   XInitThreads();
 #endif
 #if MOZ_WIDGET_GTK == 2
   XRE_GlibInit();
 #endif
 #ifdef MOZ_WIDGET_GTK
   // Setting the name here avoids the need to pass this through to gtk_init().
   g_set_prgname(aArgv[0]);
+
+#if MOZ_WIDGET_GTK == 3 && defined(MOZ_X11)
+  // Disable XInput2 support due to focus bugginess. See bugs 1182700, 1170342.
+  const char* useXI2 = PR_GetEnv("MOZ_USE_XINPUT2");
+  if (!useXI2 || (*useXI2 == '0')) {
+    gdk_disable_multidevice();
+  }
+#endif
 #endif
 
 #ifdef OS_POSIX
   if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS") ||
       PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
     printf_stderr("\n\nCHILDCHILDCHILDCHILD\n  debug me @ %d\n\n",
                   base::GetCurrentProcId());
     sleep(30);