Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: ui/events/x/touch_factory_x11.cc

Issue 59903023: Plumb maxTouchPoints for AuraX11 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rename MaxTouchPoints() to GetMaxTouchPoints() Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/x/touch_factory_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/touch_factory_x11.cc
diff --git a/ui/events/x/touch_factory_x11.cc b/ui/events/x/touch_factory_x11.cc
index 84066e3cb0b3391e690b7f21a47c82baddabfd3e..da9d95ab8ad2930fbf7870f6706987ac7a775dda 100644
--- a/ui/events/x/touch_factory_x11.cc
+++ b/ui/events/x/touch_factory_x11.cc
@@ -29,6 +29,7 @@ TouchFactory::TouchFactory()
touch_device_available_(false),
touch_events_disabled_(false),
touch_device_list_(),
+ max_touch_points_(-1),
id_generator_(0) {
if (!DeviceDataManager::GetInstance()->IsXInput2Available())
return;
@@ -80,6 +81,7 @@ void TouchFactory::UpdateDeviceList(Display* display) {
touch_device_available_ = false;
touch_device_lookup_.reset();
touch_device_list_.clear();
+ max_touch_points_ = -1;
#if !defined(USE_XI2_MT)
// NOTE: The new API for retrieving the list of devices (XIQueryDevice) does
@@ -132,6 +134,8 @@ void TouchFactory::UpdateDeviceList(Display* display) {
touch_device_lookup_[devinfo->deviceid] = true;
touch_device_list_[devinfo->deviceid] = true;
touch_device_available_ = true;
+ if (tci->num_touches > 0 && tci->num_touches > max_touch_points_)
+ max_touch_points_ = tci->num_touches;
}
}
}
@@ -237,6 +241,10 @@ bool TouchFactory::IsTouchDevicePresent() {
return !touch_events_disabled_ && touch_device_available_;
}
+int TouchFactory::GetMaxTouchPoints() const {
+ return max_touch_points_;
+}
+
void TouchFactory::SetTouchDeviceForTest(
const std::vector<unsigned int>& devices) {
touch_device_lookup_.reset();
« no previous file with comments | « ui/events/x/touch_factory_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698