[gtk/shortcuts-rebased-again: 15/171] widget: Bring back _gtk_widget_list_controllers()
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/shortcuts-rebased-again: 15/171] widget: Bring back _gtk_widget_list_controllers()
- Date: Mon, 24 Jun 2019 23:05:46 +0000 (UTC)
commit fd9d7c67d5a2252678f8431875b5f32f6ebd1dc7
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon May 13 16:22:25 2019 -0300
widget: Bring back _gtk_widget_list_controllers()
Will be used by shourtcuts.
gtk/gtkwidget.c | 21 +++++++++++++++++++++
gtk/gtkwidgetprivate.h | 2 ++
2 files changed, 23 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 0c653a90f8..e6abeb926a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12604,6 +12604,27 @@ gtk_widget_remove_controller (GtkWidget *widget,
gtk_list_list_model_item_removed (priv->controller_observer, before);
}
+GList *
+_gtk_widget_list_controllers (GtkWidget *widget,
+ GtkPropagationPhase phase)
+{
+ GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
+ GList *l, *retval = NULL;
+
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ for (l = priv->event_controllers; l; l = l->next)
+ {
+ GtkEventController *controller = l->data;
+
+ if (controller != NULL &&
+ phase == gtk_event_controller_get_propagation_phase (controller))
+ retval = g_list_prepend (retval, controller);
+ }
+
+ return retval;
+}
+
gboolean
_gtk_widget_consumes_motion (GtkWidget *widget,
GdkEventSequence *sequence)
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 26df307cc2..dd56f60a9c 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -297,6 +297,8 @@ void _gtk_widget_update_parent_muxer (GtkWidget *widget
GtkActionMuxer * _gtk_widget_get_action_muxer (GtkWidget *widget,
gboolean create);
+GList * _gtk_widget_list_controllers (GtkWidget *widget,
+ GtkPropagationPhase phase);
gboolean _gtk_widget_consumes_motion (GtkWidget *widget,
GdkEventSequence *sequence);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]