diff --git a/widget/windows/InputDeviceUtils.cpp b/widget/windows/InputDeviceUtils.cpp index 7e9a2b07ca09..6969f62f1bdf 100644 --- a/widget/windows/InputDeviceUtils.cpp +++ b/widget/windows/InputDeviceUtils.cpp @@ -10,7 +10,6 @@ #include #include #include -#include namespace mozilla { namespace widget { @@ -38,32 +37,5 @@ InputDeviceUtils::UnregisterNotification(HDEVNOTIFY aHandle) 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 diff --git a/widget/windows/InputDeviceUtils.h b/widget/windows/InputDeviceUtils.h index 75efc7d95c77..0b586f32b814 100644 --- a/widget/windows/InputDeviceUtils.h +++ b/widget/windows/InputDeviceUtils.h @@ -16,9 +16,6 @@ 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 diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index 204dcc80b993..03656197da6c 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -13,7 +13,6 @@ #include "gfxUtils.h" #include "nsWindow.h" #include "nsWindowDefs.h" -#include "InputDeviceUtils.h" #include "KeyboardLayout.h" #include "mozilla/ArrayUtils.h" #include "mozilla/BackgroundHangMonitor.h" @@ -1901,26 +1900,7 @@ IsTabletDevice() 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 */ @@ -1932,7 +1912,7 @@ WinUtils::GetPrimaryPointerCapabilities() } if (IsMousePresent()) { - return PointerCapabilities::Fine | + return PointerCapabilities::Fine| PointerCapabilities::Hover; }