Backed out changeset c50a3b343ac8 (bug 1493128) for build bustages on InputDeviceUtils.cpp. CLOSED TREE

This commit is contained in:
Brindusan Cristian 2018-10-04 09:42:41 +03:00
Родитель 9998d72afc
Коммит fe7f3f9eda
3 изменённых файлов: 2 добавлений и 53 удалений

Просмотреть файл

@ -10,7 +10,6 @@
#include <dbt.h>
#include <hidclass.h>
#include <ntddmou.h>
#include <setupapi.h>
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

Просмотреть файл

@ -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

Просмотреть файл

@ -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;
}