Skip to content

Instantly share code, notes, and snippets.

@cynthia
Created September 11, 2014 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cynthia/fe95daed5322109f567c to your computer and use it in GitHub Desktop.
Save cynthia/fe95daed5322109f567c to your computer and use it in GitHub Desktop.
diff --git a/ui/base/touch/touch_device_win.cc b/ui/base/touch/touch_device_win.cc
index ba5c260..7862780 100644
--- a/ui/base/touch/touch_device_win.cc
+++ b/ui/base/touch/touch_device_win.cc
@@ -4,6 +4,7 @@
#include "ui/base/touch/touch_device.h"
#include "base/win/windows_version.h"
+#include "base/win/win_util.h"
#include <windows.h>
namespace ui {
@@ -15,7 +16,8 @@ bool IsTouchDevicePresent() {
}
int MaxTouchPoints() {
- return GetSystemMetrics(SM_MAXIMUMTOUCHES);
+ return (base::win::IsTouchEnabledDevice()) ?
+ GetSystemMetrics(SM_MAXIMUMTOUCHES) : 0;
}
} // namespace ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment