Commit Graph

38471 Commits

Author SHA1 Message Date
72f8c673da gesture: emit the current state on ::sequence-state-changed 2014-05-23 19:54:25 +02:00
ae241714c4 gesture: group continue conditions together 2014-05-23 19:54:25 +02:00
8ebcca2ef6 gesture: return TRUE if the sequence state was already set 2014-05-23 19:54:25 +02:00
f3257e1a54 gesture: fix compiler warning 2014-05-23 19:54:25 +02:00
4570837e48 gesture: ignore events if now widget window was found 2014-05-23 19:54:25 +02:00
759705d3e6 eventcontroller: Add propagation-phase property
This is so we don't have to specify the capture phase for
every controller. The default "bubble" value will be sane
on most situations.
2014-05-23 19:54:25 +02:00
2ed086748f treeview: remove superfluous GTK+ grabs 2014-05-23 19:54:25 +02:00
2ef4f1bc61 textview: remove superfluous GTK+ grabs 2014-05-23 19:54:25 +02:00
bae68b5511 iconview: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
46b4e5d388 combobox: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
db14e22f06 cellrendereraccel: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
f766109b5b Revert "gtk: Remove propagation limit of captured events on the grab widget"
This reverts commit 6511f411955adba4f960b8b07d39b93785afe33e.
2014-05-23 19:54:24 +02:00
cdcc536ddc longpress: Use xsettings to determine long press duration
GtkSettings::gtk-long-press-time is used to this effect.
2014-05-23 19:54:24 +02:00
1403ebb097 settings: Add gtk-long-press-time setting
This setting determines the duration of a button/touch press to
be considered a long press.
2014-05-23 19:54:24 +02:00
61e88c251e window: Use gestures for window moving/resizing
A multipress gesture is used to control all this, replacing
single/double click custom code, and triggering window dragging
when the multipress is stopped, yet active (ie. the sequence remains
pressed).
2014-05-23 19:54:24 +02:00
185da29b68 treeview: Use multipress gesture for row activation
Replace custom double click detection with multipress gesture
2014-05-23 19:54:24 +02:00
b0eef458d1 dnd: Use GtkGestureDrag to initiate DnD
This gesture is used by gtk_drag_source_set() to determine
whether dragging moved past the threshold. The gesture events
are handled via the usual ::event callbacks, so we don't mess
up with callers expecting that to happen in a signal handler.

If the sequence gets claimed somewhere else in the event widget
stack, the DnD gesture will be cancelled.
2014-05-23 19:54:24 +02:00
6c78716531 scrolledwindow: Ensure the dragging sequence gets denied if more touches come in
This allows children to receive an emulated press, and handle it together with
the new touch that made the scrolledwindow sequence denied.
2014-05-23 19:54:24 +02:00
564789777a scrolledwindow: Fix overshoot coordinates
With gtk_gesture_get_point() returning events in
gtk_event_controller_get_widget() coordinates, we no longer need
to compensate for the overshoot here.
2014-05-23 19:54:24 +02:00
38e40a55f4 widget: Add gtk_widget_set_gesture_state()
This helper function ensures the state is propagated for
all the active sequences in the given gesture.
2014-05-23 19:54:24 +02:00
8e1d5f98de widget: Improve button press emulation on sequence denied
Ensure that state being set on pointer emulating touches actually
gets propagated properly on widgets with gestures that only handle
pointer events.
2014-05-23 19:54:24 +02:00
c49ac32393 swipe: Dont emit swipe() if the gesture was denied rather than finished 2014-05-23 19:54:24 +02:00
55683c075c drag: Make API offsets based
It is generally more useful to get offsets right away,
than having to calculate those from the start point.
2014-05-23 19:54:24 +02:00
6cd0e733f5 scrolledwindow: Use GtkGestureSingle API 2014-05-23 19:54:24 +02:00
cece9cac07 scrolledwindow: Update gesture API change. 2014-05-23 19:54:23 +02:00
84885c6e26 demo: Update to gesture API change 2014-05-23 19:54:23 +02:00
a56a9e4a62 widget: Reset gestures on grab-notify
If it is determined that the gesture will stop receiving
events, reset the gesture altogether.
2014-05-23 19:54:23 +02:00
997f05d99b widget: Make helper gesture API take GtkGestures
GtkEventController may be certainly useful to keep event
handling self-contained in other places than gestures, but
the current widget API is highly related to gestures, so
just using GtkGesture as the argument there will be quite
more convenient. The other places where GtkEventController
make sense as a base object will better provide their own
hooks.
2014-05-23 19:54:23 +02:00
026b5014e8 Add: GTK_PHASE_NONE value to GtkCapturePhase.
Gestures attached with this phase will expect callers to have it
receive events through gtk_event_controller_handle_event(), but
the gesture will still be notified of sequence state changes,
grabs, etc...
2014-05-23 19:54:23 +02:00
ed5d73b49a gesture: check the gesture after denying a sequence.
So the gesture emits end() timely.
2014-05-23 19:54:23 +02:00
03381beacc gesture: Offer always coordinates in the gesture widget coordinate space
Translate events meant for other widgets/windows, so gtk_gesture_get_point()
always returns coordinates based on the gtk_event_controller_get_widget()
allocation.
2014-05-23 19:54:23 +02:00
4c34d4566c multipress: Remove unused signal argument 2014-05-23 19:54:23 +02:00
dca169d9f1 swipe: Make a subclass of GtkGestureSingle 2014-05-23 19:54:23 +02:00
315aedf5c8 drag: Make a subclass of GtkGestureSingle 2014-05-23 19:54:23 +02:00
000f38ed97 multipress: Make a subclass of GtkGestureSingle
The redundant API has been removed here.
2014-05-23 19:54:23 +02:00
3db87cb0b7 longpress: Make a subclass of GtkGestureSingle
the redundant API here has been removed.
2014-05-23 19:54:23 +02:00
5f24d1a519 gesture: Only recognize gestures with as many interacting touches as those handled
If a gesture has denied sequences (so those are presumably handled above/below
the widget), it shouldn't attempt to handle extra touches, even if those end
up matching the expected number of touches.
2014-05-23 19:54:23 +02:00
b5c319b56f gesture: Limit API calls to non-denied sequences
Gestures do track those internally, but information about those
shouldn't be leaked on calls.
2014-05-23 19:54:23 +02:00
2285157c7d gesture: Require BUTTON_PRESS/TOUCH_BEGIN for sequences to be initiated.
Gestures should always receive one of such events in order to be activated,
and the propagation mechanism will ensure they do so if the original event
was caught up the widget hierarchy by another gesture that is now declining
the sequence.
2014-05-23 19:54:23 +02:00
d89e810bd9 gesture: Only track non denied sequences in get_last_updated_sequence() 2014-05-23 19:54:23 +02:00
b7435a0290 gesture: cancel all ongoing sequences on reset() 2014-05-23 19:54:23 +02:00
d2c9b9c2aa gesture: Skip non-device events early. 2014-05-23 19:54:23 +02:00
25ece22013 gesture: Add gtk_gesture_[sg]et_window()
This can be used to restrict a gesture to an specific GdkWindow,
all events will be checked to happen on/within that window.
2014-05-23 19:54:22 +02:00
7f787e1d3b docs: Add GtkGestureSingle to docs 2014-05-23 19:54:22 +02:00
c4944b0376 gesture: Remove the touch-only property
This is handled in GtkGestureSingle.
2014-05-23 19:54:22 +02:00
d4d0f13c3a Add GtkGestureSingle
This is a GtkGesture subclass, specific to single-touch (or
mouse operated) gestures.
2014-05-23 19:54:22 +02:00
49e9ba122a ...and add the right include instead 2014-05-23 19:54:22 +02:00
a1aeaa6b07 Remove a doubled line 2014-05-23 19:54:22 +02:00
8d2f81cca4 scrolledwindow: Use gesture button/touch press synthesization
This makes scrolled window fully compatible again wrt the
GtkScrolledWindow::capture-button-press property.
2014-05-23 19:54:22 +02:00
36106c19d4 widget: Propagate touch/button press events when a sequence is denied
If the captured touch begin or button press event have been consumed
for the given sequence, propagate it upwards if the sequence goes from
claimed to denied, so the widgets on the way to the event widget receive
a coherent event stream now that they're going to receive events.
2014-05-23 19:54:22 +02:00