Bug 1345355 - Don't register a window as touch-enabled if there's no touch device supported. r=jimm

MozReview-Commit-ID: IycX3e0I5TQ
This commit is contained in:
Kartikaya Gupta
2017-03-09 18:59:32 -05:00
parent 2a3140feb8
commit 2de7726f1c
2 changed files with 10 additions and 0 deletions

View File

@@ -1704,6 +1704,15 @@ void nsWindow::SetThemeRegion()
**************************************************************/
void nsWindow::RegisterTouchWindow() {
if (!WinUtils::IsTouchDeviceSupportPresent() &&
!Preferences::GetBool("test.force_register_touch_windows", false)) {
// If we don't have any touch support on the device, don't
// register any touch windows because it'll consume WM_GESTURE
// events from other devices.
// For testing purposes we have a pref to override this behaviour
// and force the registration of touch windows.
return;
}
mTouchWindow = true;
mGesture.RegisterTouchWindow(mWnd);
::EnumChildWindows(mWnd, nsWindow::RegisterTouchForDescendants, 0);