Commit 61c205d3 authored by Carlos Garnacho's avatar Carlos Garnacho

eventcontroller: Add private ::filter method

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.
parent 7a288fb3
......@@ -145,6 +145,7 @@ gtk_event_controller_class_init (GtkEventControllerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
klass->filter_event = gtk_event_controller_handle_event_default;
klass->handle_event = gtk_event_controller_handle_event_default;
object_class->set_property = gtk_event_controller_set_property;
......@@ -218,6 +219,9 @@ gtk_event_controller_handle_event (GtkEventController *controller,
controller_class = GTK_EVENT_CONTROLLER_GET_CLASS (controller);
if (controller_class->filter_event (controller, event))
return retval;
if (controller_class->handle_event)
{
g_object_ref (controller);
......
......@@ -36,6 +36,9 @@ struct _GtkEventControllerClass
void (* reset) (GtkEventController *controller);
/*<private>*/
gboolean (* filter_event) (GtkEventController *controller,
const GdkEvent *event);
gpointer padding[10];
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment