summaryrefslogtreecommitdiff
path: root/gtk/gtkgesture.c
Commit message (Collapse)AuthorAgeFilesLines
* gtkgesture: Fix get-center for touchpad gesturesYariv Barkan2020-01-171-1/+8
| | | | | | Touchpad gestures have only a single event sequence. The current 'center' of the gesture is the starting point + accumulated deltas. Update gtk_gesture_get_bounding_box_center() accordingly.
* gtk: fix all uses of g_cclosure_marshal_genericChristian Hergert2019-06-011-1/+6
| | | | | | This adds specific marshallers for all of the locations where a generic marshaller is being used. It also provides va_marshallers to reduce the chances that we get stack traces from perf going through ffi_call_unix64.
* Merge branch 'gesture-docs' into 'master'Matthias Clasen2018-05-301-3/+3
| | | | | | | | | | | Gesture stuff See merge request GNOME/gtk!169 (cherry picked from commit 8b24d59cde9410db28c7b61d323fa8b1f0180300) 334c7911 gesture: Fix get_last_event() docs e9765c04 gesture: Fix code snippet 4d2b39d9 gesturemultipress: Don’t fire ::released after ::cancel
* gtkgesture: Do not ignore events from other GdkWindows than the widget'sCarlos Garnacho2017-07-261-1/+1
| | | | | | | | | | | There's GDK grab situations (eg. pointer motion outside the grab window in combination with a GTK+ grab) where a gesture may receive events from windows that are not the widget's. The _update_widget_coordinates() still does work for those situations, so just let these events go through instead of ignoring them. https://bugzilla.gnome.org/show_bug.cgi?id=782870
* Add a few missing (nullable) annotationsTimm Bäder2017-02-171-2/+2
|
* Docs: Clarify life cycle issueMatthias Clasen2016-05-111-0/+4
| | | | | gtk_gesture_get_last_event() wasn't very clear about how long it is safe to use the returned pointer.
* gesture: Don't leak stashed eventsMatthias Clasen2016-05-011-1/+12
| | | | These events were never freed.
* Various documentation fixesTimm Bäder2016-02-081-2/+2
| | | | | | Always have Since: annotations at the very bottom, use the correct ClassName::signal-name/ClassName:property-name syntax, fix a few typos in type names, wrong function names, non-existing type names, etc.
* gtk: Fix some return-values annotations (transfer none/full)Rico Tzschichholz2016-02-081-1/+1
|
* introspection: This patch fixes nullable return values fixes for the ↵Alberto Ruiz2016-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | following symbols in gtk gtk_accel_group_query gtk_accel_group_from_accel_closure gtk_accel_label_get_accel_widget gtk_accessible_get_widget gtk_actionable_get_action_name gtk_app_chooser_get_app_info gtk_app_chooser_button_get_heading gtk_app_chooser_dialog_get_heading gtk_application_get_window_by_id gtk_assistant_get_nth_page gtk_binding_set_find gtk_builder_get_object gtk_builder_lookup_callback_symbol gtk_builder_get_application gtk_button_get_image gtk_cell_area_get_focus_from_sibling gtk_cell_renderer_start_editing gtk_cell_view_get_model gtk_cell_view_get_displayed_row gtk_clipboard_get_owner gtk_container_get_focus_child gtk_container_get_focus_vadjustment gtk_container_get_focus_hadjustment gtk_dialog_get_widget_for_response gtk_drag_get_source_widget gtk_drag_dest_get_target_list gtk_drag_source_get_target_list gtk_entry_completion_get_model gtk_entry_completion_compute_prefix gtk_expander_get_label_widget gtk_file_chooser_get_filename gtk_file_chooser_get_current_folder gtk_file_chooser_get_uri gtk_file_chooser_get_current_folder_uri gtk_file_chooser_get_preview_widget gtk_file_chooser_get_preview_file gtk_file_chooser_get_preview_filename gtk_file_chooser_get_preview_uri gtk_file_chooser_get_extra_widget gtk_file_chooser_get_filter gtk_file_chooser_native_get_accept_label gtk_file_chooser_native_get_cancel_label gtk_file_filter_get_name gtk_font_chooser_get_font_family gtk_font_chooser_get_font_face gtk_font_chooser_get_font gtk_font_chooser_get_font_desc gtk_font_chooser_get_font_map gtk_frame_get_label gtk_gesture_get_device gtk_gesture_get_window gtk_gl_area_get_error gtk_header_bar_get_title gtk_header_bar_get_subtitle gtk_header_bar_get_custom_title gtk_icon_info_get_filename gtk_icon_view_get_path_at_pos gtk_icon_view_get_model gtk_image_get_pixbuf gtk_image_get_animation gtk_label_get_mnemonic_widget gtk_label_get_attributes gtk_check_version gtk_menu_button_get_popup gtk_menu_button_get_menu_model gtk_menu_button_get_align_widget gtk_menu_button_get_popover gtk_menu_item_get_submenu gtk_menu_item_get_accel_path gtk_native_dialog_get_title gtk_native_dialog_get_transient_for gtk_notebook_get_nth_page gtk_notebook_get_tab_label_text gtk_notebook_get_menu_label gtk_notebook_get_menu_label_text gtk_notebook_get_group_name gtk_notebook_get_action_widget gtk_offscreen_window_get_surface gtk_offscreen_window_get_pixbuf gtk_paned_get_child1 gtk_paned_get_child2 gtk_places_sidebar_get_location gtk_places_sidebar_get_nth_bookmark gtk_plug_get_socket_window gtk_popover_get_default_widget gtk_progress_bar_get_text gtk_recent_filter_get_name gtk_recent_manager_lookup_item gtk_settings_get_default gtk_socket_get_plug_window gtk_stack_sidebar_get_stack gtk_stack_switcher_get_stack gtk_style_context_get_section gtk_style_context_get_parent gtk_style_context_get_frame_clock gtk_test_find_widget gtk_text_buffer_get_mark gtk_text_tag_table_lookup gtk_text_view_get_tabs gtk_text_view_toggle_cursor_visible gtk_text_view_get_window gtk_toolbar_get_nth_item gtk_tool_button_get_label gtk_tool_button_get_icon_name gtk_tool_button_get_label_widget gtk_tool_button_get_icon_widget gtk_tool_palette_get_drop_item gtk_tool_palette_get_drop_group gtk_tree_model_filter_convert_child_path_to_path gtk_tree_model_filter_convert_path_to_child_path gtk_tree_model_sort_convert_child_path_to_path gtk_tree_model_sort_convert_path_to_child_path gtk_tree_view_get_column gtk_tree_view_get_bin_window gtk_tree_view_column_get_widget gtk_tree_view_column_get_tree_view gtk_widget_get_frame_clock gtk_window_group_get_current_device_grab GtkTextBufferSerializeFunc
* Gestures: Add some nullable annotationsTimm Bäder2015-12-121-2/+2
|
* gesture: strengthen against destroyed windowsCarlos Garnacho2015-09-211-1/+5
| | | | | | | Bail out when we receive an event with an already destroyed window, we'll hopefully get reset/cancelled afterwards on grab broken events. https://bugzilla.gnome.org/show_bug.cgi?id=755352
* Intern all signal names beforehandMatthias Clasen2015-09-121-5/+5
| | | | This avoids pointless allocations
* gtkgesture: Add note to gtk_gesture_get_bounding_box()Carlos Garnacho2015-08-121-0/+6
| | | | | This is the only function that's will be semantically confusing with touchpad gesture events, explain what's to be expected there.
* gtkgesture: Add touchpad gesture event bit to the controller evmaskCarlos Garnacho2015-08-121-1/+2
|
* gtkgesture: Add docs blurb about touchpad gesturesCarlos Garnacho2015-08-121-0/+9
| | | | Not too long though, the precautions to take are minimal.
* gtkgesture: Accumulate touchpad events' dx/dy in point dataCarlos Garnacho2015-08-121-1/+56
| | | | | This will make the gesture "center" the pointer position, plus the accumulated dx/dy throughout the gesture progress.
* gtkgesture: Handle touchpad eventsCarlos Garnacho2015-08-121-6/+81
| | | | | | | | | | | | | | | | | | These will be mutually exclusive with touch events, so it won't be possible to trigger gestures through mixed input and whatnot. The accounting of touchpad events is slightly different, there will be a single internal PointData struct, stored in the hashtable with the NULL event sequence/key (same than pointer events in this regard), just that the events stored will be GdkEventTouchpad*, so will hold information about all fingers at once. But this difference is just internal, the GtkGesture API doesn't make explicit assumptions about the number of points (the closest to a per-point query API is gtk_gesture_get_sequences()). All signals emitted just contain the last changed GdkEventSequence, and API takes GdkEventSequences, so everything is consistent with sequence=NULL for touchpad events.
* gtkgesture: Refactor n-points querying into a single functionCarlos Garnacho2015-08-121-11/+21
| | | | | | | | | Along the code, we're basically asking for 1) the total count of touchpoints, and 2) the number of active touchpoints (not denied nor ended). Wrap both usecases into a _gtk_gesture_get_n_physical_touchpoints(), and replace all occurrences.
* gtkgesture: Filter out touchpad events by default.Carlos Garnacho2015-08-121-0/+16
| | | | | | | | | The gestures that don't want touchpad gesture events are majority, even those that want such events will only listen to subsets (eg. pinch, swipe,...). So it makes sense to ignore touchpad events by default, and let subclasses opt those in.
* gtkgesture: Refactor gtk_gesture_handle_event()Carlos Garnacho2015-08-121-20/+26
| | | | | | We'll be dealing with event types and touchpad gesture phases, replace the switch by a battery of if/elses. Otherwise, it's just an style change.
* GtkGesture: minor cleanupCarlos Garnacho2015-07-241-2/+1
| | | | | We're not really using the coordinates in that function, we just double check it's not an unrelated event.
* gesture: On cancel, remove touchpoint before checking the recognized stateCarlos Garnacho2015-03-021-1/+2
| | | | Otherwise the touch being removed doesn't account in recognition.
* gesture: Document pitfalls on foreign gesture state changesCarlos Garnacho2014-09-291-0/+31
| | | | | | Add some docs/example about the possible event handling ordering issues that may appear on GtkGesture::begin between multiple gesture groups. Mostly relevant for state changes.
* Trivial: reword docs a bitMatthias Clasen2014-09-261-2/+2
|
* GtkGesture: Don't leak the group linkMatthias Clasen2014-06-281-1/+5
| | | | Found in a valgrind log.
* gesture: Consume the event triggering ::begin if reset within the handlerCarlos Garnacho2014-06-251-17/+40
| | | | | | | | | If the event triggers GtkGesture::begin, and the handler ends up resetting the gesture (say, due to taking a grab somewhere else within the handler), still take the event as "managed", as it actually triggered recognition, even if just to end abruptly. https://bugzilla.gnome.org/show_bug.cgi?id=731711
* gesture: Ensure late gestures handling the sequence get the group stateCarlos Garnacho2014-06-031-0/+30
| | | | | | | | | It might happen that a gesture claims a sequence before any other gesture in its group even handled a single event from that sequence. In that case, ensure the state is set accordingly right when the sequence is handled in those. The "group" gesture testcase has been updated to observe this behavior.
* gesture: Fix wrong assert in gtk_gesture_set_windowCarlos Garnacho2014-05-271-1/+1
| | | | | The window must be part of the event controller widget, so fix the inverted logic.
* gesture: Replace gtk_gesture_attach/detach with event controller APICarlos Garnacho2014-05-271-56/+4
| | | | | | | | Event controllers now auto-attach, and the GtkCapturePhase only determines when are events dispatched, but all controllers are managed by the widget wrt grabs. All callers have been updated.
* eventcontroller: Make the event-mask property and methods private.Carlos Garnacho2014-05-271-0/+1
| | | | | This will rarely have any use if no subclassing is allowed, so just make it private for our own.
* gesture: Use GdkEventSequence GType in signalsCarlos Garnacho2014-05-231-5/+5
|
* gesture: Introspection fixesCarlos Garnacho2014-05-231-2/+2
| | | | | Set annotations on return values for gtk_gesture_get_device() and gtk_gesture_get_window().
* Docs: Cosmetic fixesMatthias Clasen2014-05-231-26/+28
|
* docs: Correct a referenceMatthias Clasen2014-05-231-1/+2
|
* Revert "docs: More GtkEventController removal"Matthias Clasen2014-05-231-1/+1
| | | | This reverts commit 75f503fb1fc9068c9e1a0d02126c55addbe8eb3e.
* Docs: Add information about event propagationMatthias Clasen2014-05-231-3/+26
|
* Docs: Minor changesMatthias Clasen2014-05-231-1/+1
|
* Document gtk_gesture_set_stateMatthias Clasen2014-05-231-0/+14
|
* docs: More GtkEventController removalMatthias Clasen2014-05-231-1/+1
|
* gesture: Declare GtkGesture:window as an object propertyCarlos Garnacho2014-05-231-5/+5
|
* gesture: Add GTK_PHASE_TARGETCarlos Garnacho2014-05-231-1/+1
| | | | | | | This phase is meant to run in the default widget handlers, as opposed to externally as in the bubble/capture phase. This will be most usually the expected phase for every controller replacing code in event handlers in GTK+, just so invocation and triggering order is kept unaltered.
* gesture: Handle GdkEventGrabBrokenCarlos Garnacho2014-05-231-0/+27
| | | | | | That may happen separately from grab-notify, and also due to external reasons, so ensure all sequences are cancelled if a grab is taken in some GdkWindows that would obscure events on the controller.
* widget: tighten the conditions at which a press event is emulatedCarlos Garnacho2014-05-231-2/+5
| | | | | | | Make it really sure that the event is only emitted after every gesture that consumed the button press is done with the sequence. The event must only be emulated if a gesture in the capture phase happened to consume the event, be cancelled, and
* gesture: Prevent against sequence cancellation within gtk_gesture_set_state()Carlos Garnacho2014-05-231-5/+6
| | | | | | Sequences may be cancelled within the ::sequence-state-changed handler, which would change the points hashtable as it's being iterated in this function. So iterate over a list of sequences and let the hashtable change freely.
* gesture: Make gtk_gesture_get_last_update_time() privateCarlos Garnacho2014-05-231-17/+3
|
* gesture: Remove gtk_gesture_get_last_event_typeCarlos Garnacho2014-05-231-29/+0
|
* gesture: make gtk_gesture_cancel_sequence() privateCarlos Garnacho2014-05-231-13/+3
|
* gesture: Make gtk_gesture_check() privateCarlos Garnacho2014-05-231-38/+8
|
* gesture: Simplify gesture/widget interaction public APICarlos Garnacho2014-05-231-0/+49
| | | | | | | | | | | The propagation phase property/methods in GtkEventController are gone, This is now set directly on the GtkWidget add/remove controller API, which has been made private. The only public bit now are the new functions gtk_gesture_attach() and gtk_gesture_detach() that will use the private API underneath. All callers have been updated.