Gestures: Report gesture first, then schedule next timer callback

The TimerCallback sends a gesture first, then set the next timer callback.
Rearrange PushHardwareState to follow the same sequence.

This makes the code slightly more consistent and therefore understandable.
There is also a tiny performance boost, since the XEvents for a given
Gesture will now be generated slightly sooner.

Lastly, and perhaps most importantly, this also allows for a future change
to allow a HardwareState to immediately trigger a Timer Callback.
Without this change, the Gesture for the immediate Timer Callback would
actually be processed BEFORE the Gesture for the original HardwareState.

BUG=chromium-os:34570
TEST=unittests

Change-Id: I44b1e5dc2fd4c4ca562711764252428f4f1c15ff
Reviewed-on: https://gerrit.chromium.org/gerrit/33614
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
1 file changed