Backed out changeset c50a3b343ac8 (bug 1493128) for build bustages on InputDeviceUtils.cpp. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Thu, 04 Oct 2018 09:42:41 +0300
changeset 495257 ee830971f05015788d8087fb2beb2eb8ba8223bf
parent 495256 b5a47b972169a6fea58589a0513ddce7b289c7b9
child 495258 c4c98ffc7f4f34ca6823ee35fb9f7d869d34ce28
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1493128
milestone64.0a1
backs outc50a3b343ac847e4e112bbb8b4c2892167813b80
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
Backed out changeset c50a3b343ac8 (bug 1493128) for build bustages on InputDeviceUtils.cpp. CLOSED TREE
widget/windows/InputDeviceUtils.cpp
widget/windows/InputDeviceUtils.h
widget/windows/WinUtils.cpp
--- a/widget/windows/InputDeviceUtils.cpp
+++ b/widget/windows/InputDeviceUtils.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "InputDeviceUtils.h"
 
 #define INITGUID
 #include <dbt.h>
 #include <hidclass.h>
 #include <ntddmou.h>
-#include <setupapi.h>
 
 namespace mozilla {
 namespace widget {
 
 HDEVNOTIFY
 InputDeviceUtils::RegisterNotification(HWND aHwnd)
 {
   DEV_BROADCAST_DEVICEINTERFACE filter = {};
@@ -33,37 +32,10 @@ void
 InputDeviceUtils::UnregisterNotification(HDEVNOTIFY aHandle)
 {
   if (!aHandle) {
     return;
   }
   UnregisterDeviceNotification(aHandle);
 }
 
-DWORD
-InputDeviceUtils::CountMouseDevices()
-{
-  HDEVINFO hdev = SetupDiGetClassDevs(&GUID_DEVINTERFACE_MOUSE,
-                                      nullptr,
-                                      nullptr,
-                                      DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);
-  if (hdev == INVALID_HANDLE_VALUE) {
-    return 0;
-  }
-
-  DWORD count = 0;
-  SP_INTERFACE_DEVICE_DATA info = {};
-  info.cbSize = sizeof(SP_INTERFACE_DEVICE_DATA);
-  while (SetupDiEnumDeviceInterfaces(hdev,
-                                     nullptr,
-                                     &GUID_DEVINTERFACE_MOUSE,
-                                     index,
-                                     &info)) {
-    if (info.Flags & SPINT_ACTIVE) {
-      count++;
-    }
-  }
-  SetupDiDestroyDeviceInfoList(hdev);
-  return count;
-}
-
 } // namespace widget
 } // namespace mozilla
--- a/widget/windows/InputDeviceUtils.h
+++ b/widget/windows/InputDeviceUtils.h
@@ -11,16 +11,13 @@
 
 namespace mozilla {
 namespace widget {
 
 class InputDeviceUtils {
 public:
   static HDEVNOTIFY RegisterNotification(HWND aHwnd);
   static void UnregisterNotification(HDEVNOTIFY aHandle);
-
-  // Returns the number of mouse type devices connected to this system.
-  static DWORD CountMouseDevices();
 };
 
 } // namespace widget
 } // namespace mozilla
 #endif // mozilla_widget_InputDeviceUtils_h__
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -8,17 +8,16 @@
 
 #include <knownfolders.h>
 #include <winioctl.h>
 
 #include "gfxPlatform.h"
 #include "gfxUtils.h"
 #include "nsWindow.h"
 #include "nsWindowDefs.h"
-#include "InputDeviceUtils.h"
 #include "KeyboardLayout.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/BackgroundHangMonitor.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/DataSurfaceHelpers.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/RefPtr.h"
@@ -1896,48 +1895,29 @@ IsTabletDevice()
     return !GetSystemMetrics(SM_CONVERTIBLESLATEMODE);
   }
   return false;
 }
 
 static bool
 IsMousePresent()
 {
-  if (!::GetSystemMetrics(SM_MOUSEPRESENT)) {
-    return false;
-  }
-
-  DWORD count = InputDeviceUtils::CountMouseDevices();
-  if (!count) {
-    return false;
-  }
-
-  // If there is a mouse device and if this machine is a tablet or has a
-  // digitizer, that's counted as the mouse device.
-  // FIXME: Bug 1495938:  We should drop this heuristic way once we find out a
-  // reliable way to tell there is no mouse or not.
-  if (count == 1 &&
-      (WinUtils::IsTouchDeviceSupportPresent() ||
-       IsTabletDevice())) {
-    return false;
-  }
-
-  return true;
+  return ::GetSystemMetrics(SM_MOUSEPRESENT);
 }
 
 /* static */
 PointerCapabilities
 WinUtils::GetPrimaryPointerCapabilities()
 {
   if (IsTabletDevice()) {
     return PointerCapabilities::Coarse;
   }
 
   if (IsMousePresent()) {
-    return PointerCapabilities::Fine |
+    return PointerCapabilities::Fine|
            PointerCapabilities::Hover;
   }
 
   if (IsTouchDeviceSupportPresent()) {
     return PointerCapabilities::Coarse;
   }
 
   return PointerCapabilities::None;