Commit Graph

13 Commits

Author SHA1 Message Date
Carlos Garnacho
6d8842ca96 gesturesingle: Implement GtkGesture::cancel better than GtkEventController:reset
The former can be called individually on each sequence, and the latter will
always call the former on all currently active sequences, so only implementing
resetting on cancel() works for both cases. Also, chain up on subclasses
implementing cancel.

This fixes clicking on nautilus' file list after popping up a menu, as broken
grabs are one of those situations where sequences get cancelled individually,
the "current button" wasn't properly reset, and further clicks with button != 3
were ignored.
2014-06-13 01:27:31 +02:00
Matthias Clasen
3bb404f40c Don't assert in gtk_event_controller_constructed
This prevents some of our generic object implementation tests
from working with gesture objects. Instead, add g_return_if_fail
checks in all the gesture constructors.
2014-05-27 14:33:32 -04:00
Matthias Clasen
0442431943 Docs: Cosmetic fixes 2014-05-23 19:54:33 +02:00
Carlos Garnacho
d2db31ee5e multipress: Add matching ::released signal
This signal will always be paired with a ::pressed signal, unless
the sequence is cancelled, or the controller is reset. the n_press
argument in the signal always matches the ::press signal one, even
if GtkGestureMultiPress::stopped was emitted in between.
2014-05-23 19:54:30 +02:00
Carlos Garnacho
04c8b4c705 multipress: Protect against fleeting touches mistriggering events
The current sequence (as per gtk_gesture_single_get_current_sequence)
is used to find out the coordinates. And only emit ::pressed if the
gesture began through a GDK_BUTTON_PRESS/TOUCH_BEGIN (eg. not due to
an extra touch being lifted)
2014-05-23 19:54:30 +02:00
Carlos Garnacho
0288fd0a88 gesture: Make gtk_gesture_check() private 2014-05-23 19:54:29 +02:00
Matthias Clasen
42df9eda2d Prevent subclassing of gestures
For now, at least. We do this by hiding the instance and
class structures in private headers.
2014-05-23 19:54:28 +02:00
Carlos Garnacho
24dc172b46 multipress: doc fixes 2014-05-23 19:54:27 +02:00
Carlos Garnacho
4602f34111 multipress: Add missing documentation 2014-05-23 19:54:27 +02:00
Carlos Garnacho
3cc9543e64 gesturemultipress: fix reentrancy on ::reset() 2014-05-23 19:54:26 +02:00
Carlos Garnacho
4c34d4566c multipress: Remove unused signal argument 2014-05-23 19:54:23 +02:00
Carlos Garnacho
000f38ed97 multipress: Make a subclass of GtkGestureSingle
The redundant API has been removed here.
2014-05-23 19:54:23 +02:00
Carlos Garnacho
450c754c7c Add GtkGestureMultiPress
This gesture handles any number of clicks, ensuring multiple presses
stay within thresholds and timeouts. When anything of that happens,
the gesture is reset and press count starts from 1 again.

Optionally, the gesture can be given a rectangle, used in in presses > 1
to ensure the consecutive presses happen on user imposed areas.
2014-05-23 19:54:21 +02:00