Index: ui/base/x/events_x.cc |
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc |
index 59767293684217eb80346e35225ec65c75b3b887..4f2db853d7cb08892f4f8cb9a49e6dc114fc288a 100644 |
--- a/ui/base/x/events_x.cc |
+++ b/ui/base/x/events_x.cc |
@@ -359,10 +359,16 @@ int GetTouchId(const base::NativeEvent& xev) { |
#if defined(USE_XI2_MT) |
float tracking_id; |
if (!factory->ExtractTouchParam( |
- *xev, ui::TouchFactory::TP_TRACKING_ID, &tracking_id)) |
+ *xev, ui::TouchFactory::TP_TRACKING_ID, &tracking_id)) { |
LOG(ERROR) << "Could not get the slot ID for the event. Using 0."; |
- else |
+ } else { |
slot = factory->GetSlotForTrackingID(tracking_id); |
+ ui::EventType type = ui::EventTypeFromNative(xev); |
+ if (type == ui::ET_TOUCH_CANCELLED || |
+ type == ui::ET_TOUCH_RELEASED) { |
+ factory->ReleaseSlotForTrackingID(tracking_id); |
+ } |
+ } |
#else |
if (!factory->ExtractTouchParam( |
*xev, ui::TouchFactory::TP_SLOT_ID, &slot)) |