Commit 66d074f6 authored by sadrul@chromium.org's avatar sadrul@chromium.org

aura: Avoid copying a touch-event in X11.

There are two ways this was bad:
 * Copying a touch-release event ended up with an incorrect touch-id. This is
   because the original XEvent was releasing the slot-id associated with the
   tracking-id of the event. When the event is copied, the copied event then
   would look for a new touch-id for the same tracking id, and would end up with
   the first available touch-id, which may or may not be the same as the
   touch-id of the original native event (e.g. when second finger is released
   after first finger).
 * The copied XEvent was leaking, because set_delete_native_event was not being
   set on the TouchEvent. So every queued touch-event was leaking an Xevent.
   Yikes.

Making a copy of the native event does not provide any benefits. So avoid copying altogether.

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10272025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134711 0039d316-1c4b-4281-b951-d872f2087c98
parent 1d06b181
......@@ -313,9 +313,6 @@ TouchEvent* TouchEvent::Copy() const {
#if defined(OS_WIN)
if (native_event().message)
return new TouchEvent(::CopyNativeEvent(native_event()));
#else
if (native_event())
return new TouchEvent(::CopyNativeEvent(native_event()));
#endif
return new TouchEvent(*this, NULL, NULL);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment