summaryrefslogtreecommitdiff
path: root/gtk/gtkeventcontroller.c
Commit message (Collapse)AuthorAgeFilesLines
* event controller: Convert to g_object_notify_by_pspecMatthias Clasen2015-09-061-18/+20
| | | | This avoids pspec lookup overhead in g_object_notify.
* eventcontroller: Add private ::filter methodCarlos Garnacho2015-08-121-0/+4
| | | | | | | This will be used right before handle_event() in order to filter out events, useful to make the previous "no touchpad events" behavior the default, and have gesture subclasses include manually the touchpad events they handle.
* Gestures: Properly handle weak referencesMatthias Clasen2015-03-111-1/+5
| | | | | | | | Every call to g_object_add_weak_pointer must be matched with a g_object_remove_weak_pointer call, or we will get invalid writes inside GObject. https://bugzilla.gnome.org/show_bug.cgi?id=746013
* Fix 7c4bf742e82d812ecc5b0c3280db86d2689eb093Matthias Clasen2015-03-021-1/+2
| | | | | | The objects-finalize test constructs gestures with NULL as a widget. The recent addition of weak references was not ready for that.
* eventcontroller: Chain up on constructedDebarshi Ray2015-03-021-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=745225
* eventcontroller, widget: Don't crash if destroyed before the otherDebarshi Ray2015-03-021-0/+1
| | | | | | | | | | | | | | | | | | | | | There are two scenarios. A widget sub-class owns a GtkEventController and passes itself to it, or a controller owned by something else is passed a widget. In the second case, if the widget is destroyed before the controller, we will have a crash when destructing the controller because we will be accessing invalid memory. Adding a weak reference on the widget addresses that problem. This leads to a crash in the first case. When the widget is getting destroyed, it will drop the reference to its own controller. The controller will skip touching the widget because the weak reference would have turned it to NULL. However, when the widget sub-class chains up to GtkWidget it will try to free all the controllers in its list. Unfortunately, all these controllers have already been destroyed. So we need to guard against this too. https://bugzilla.gnome.org/show_bug.cgi?id=745225
* event-controller: Chain up on disposeCarlos Garnacho2015-01-141-0/+2
|
* eventcontroller: Default to GTK_PHASE_BUBBLECarlos Garnacho2014-08-151-1/+5
| | | | | | This is in practice the most common value, so make that the default https://bugzilla.gnome.org/show_bug.cgi?id=734285
* GtkEventController: Use G_PARAM_EXPLICIT_NOTIFYMatthias Clasen2014-06-091-1/+1
|
* eventcontroller: Ensure controllers stay alive during event emissionCarlos Garnacho2014-05-281-1/+5
| | | | | | Those might trigger the destruction of some widget that would dispose the event controller while the event is still being handled, so keep an extra ref on the controller during event processing.
* Don't assert in gtk_event_controller_constructedMatthias Clasen2014-05-271-3/+4
| | | | | | 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.
* eventcontroller: Hide more detailsCarlos Garnacho2014-05-271-46/+11
| | | | | Signals are left hidden, so the only entry point to handle_event/reset is API.
* gesture: Replace gtk_gesture_attach/detach with event controller APICarlos Garnacho2014-05-271-1/+105
| | | | | | | | 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-44/+1
| | | | | This will rarely have any use if no subclassing is allowed, so just make it private for our own.
* eventcontroller: introspection fixCarlos Garnacho2014-05-231-1/+1
| | | | Set transfer annotation on gtk_event_controller_get_widget()
* Docs: Cosmetic fixesMatthias Clasen2014-05-231-2/+2
|
* gesture: Simplify gesture/widget interaction public APICarlos Garnacho2014-05-231-82/+1
| | | | | | | | | | | 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.
* Prevent subclassing of gesturesMatthias Clasen2014-05-231-1/+2
| | | | | For now, at least. We do this by hiding the instance and class structures in private headers.
* eventcontroller: doc fixesCarlos Garnacho2014-05-231-2/+2
|
* eventcontroller: Add missing documentationCarlos Garnacho2014-05-231-1/+45
|
* eventcontroller: Add documentation blurbCarlos Garnacho2014-05-231-0/+21
|
* eventcontroller: Add propagation-phase propertyCarlos Garnacho2014-05-231-1/+65
| | | | | | 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.
* Add GtkEventControllerCarlos Garnacho2014-05-231-0/+265
This is a basic abstract type that handles GdkEvents.