diff options
Diffstat (limited to 'ui/base/x/events_x.cc')
-rw-r--r-- | ui/base/x/events_x.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc index 5976729..4f2db85 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)) |