• Ian Hickson's avatar
    Allow long-press gestures to continue even if buttons change. (#127877) · bc49cd1b
    Ian Hickson authored
    Previously, if you changed buttons during a long-press gesture, if it was before the gesture was accepted we would discard it, and if it was after the gesture was accepted we would silently end it without firing any of the relevant events.
    
    This silent cancelation behavior is terrible because it means there's no way for consumers to know what state they're in, so you end up with widgets that thing they're still being long-pressed even though nothing is happening.
    
    We could change the behavior in three ways, as far as I can tell:
    
    - we could send a cancel event when you change buttons. This would introduce a new kind of transition (start->cancel) which I don't think we currently require people to support. This would therefore not fix existing code and would make future code more complicated to handle a really obscure user action that it seems unlikely anyone cares about.
    
    - we could send an end event when you change buttons. This would mean the action commits, even though the user is still holding the mouse button down. This seems slightly better than the previous option but still not ideal as it means nudging the mouse button commits you even though you're still holding the button down.
    
    - we could ignore button changes after the long-press has been accepted.
    
    I implemented the last one in this PR.
    bc49cd1b