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

Unified Diff: ui/base/x/events_x.cc

Issue 8839004: Release slotId of TouchEvent when USE_XI2_MT defined (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/events_x.cc
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
index 3d3b7a65624efa1f29a59441e42b5192e4bd833d..480a0412d308ae2d4ae704c63793dc5771ab0dd3 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -349,8 +349,14 @@ int GetTouchId(const base::NativeEvent& xev) {
if (!factory->ExtractTouchParam(
*xev, ui::TouchFactory::TP_TRACKING_ID, &tracking_id))
LOG(ERROR) << "Could not get the slot ID for the event. Using 0.";
- else
+ else {
sadrul 2011/12/08 17:04:41 If you need brace in one, you should use them for
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))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698