GNOME Bugzilla – Bug 683431
PanAction::pan-stopped sometimes is emitted before ::gesture-begin
Last modified: 2012-09-06 11:19:23 UTC
If a new gesture starts before the momentum of the previous one has finished, users get their ::pan-stopped signal handlers called after the handlers for the ::gesture-begin associated to the next gesture. This is due to ::pan-stopped being emitted in the class default handler of the ::gesture-begin signal. We can add a gesture_prepare() virtual function that gets called before emitting ::gesture-begin to let GestureAction subclasses to reset their state.
Created attachment 223554 [details] [review] gesture-action: add gesture_prepare() virtual function The gesture_prepare() virtual function is called before the ::gesture-begin signal is emitted, and allows a subclass to reset its state.
Created attachment 223555 [details] [review] pan-action: emit ::pan-stopped before ::gesture-begin When starting a new gesture before the momentum of the previous one has finished the ::pan-stopped was counter-intuitively emitted after the new ::gesture-begin. Make use of gesture_prepare() to reset the state of the action right before emitting ::gesture-begin.
Review of attachment 223554 [details] [review]: looks good. we'll have to properly document the state machine, but for now it's fine.
Review of attachment 223555 [details] [review]: looks good.
Attachment 223554 [details] pushed as 2001cd7 - gesture-action: add gesture_prepare() virtual function Attachment 223555 [details] pushed as 3b298dd - pan-action: emit ::pan-stopped before ::gesture-begin