Bug 1066237 - Add explicit returning zero number of touch points when there is no touch device available. r=smaug
authorNick Lebedev <nicklebedev37@gmail.com>
Fri, 10 Oct 2014 08:36:00 -0400
changeset 209990 7d6eb07eb8840595e1cd6656ce40df9543af8c8b
parent 209989 24fe4de371259abaabe92df7f08d5bf5b3712392
child 209991 e5bc95c2b993443b8620cfeb9ad9581fb7ac6b63
push id50311
push userryanvm@gmail.com
push dateSun, 12 Oct 2014 01:39:28 +0000
treeherdermozilla-inbound@c9fa1a711dc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1066237
milestone35.0a1
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
Bug 1066237 - Add explicit returning zero number of touch points when there is no touch device available. r=smaug
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -185,16 +185,22 @@
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 using namespace mozilla::layers;
 using namespace mozilla::widget;
 
+namespace mozilla {
+namespace widget {
+  extern int32_t IsTouchDeviceSupportPresent();
+}
+}
+
 /**************************************************************
  **************************************************************
  **
  ** BLOCK: Variables
  **
  ** nsWindow Class static initializations and global variables. 
  **
  **************************************************************
@@ -3606,17 +3612,17 @@ nsWindow::UpdateThemeGeometries(const ns
   if (layerManager) {
     layerManager->SetRegionToClear(clearRegion);
   }
 }
 
 uint32_t
 nsWindow::GetMaxTouchPoints() const
 {
-  if (IsWin7OrLater()) {
+  if (IsWin7OrLater() && IsTouchDeviceSupportPresent()) {
     return GetSystemMetrics(SM_MAXIMUMTOUCHES);
   }
   return 0;
 }
 
 /**************************************************************
  **************************************************************
  **