[gtk/shortcuts-rebased-again: 15/145] 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/145] widget: Bring back _gtk_widget_list_controllers()
- Date: Sun, 23 Jun 2019 04:09:26 +0000 (UTC)
commit b0fea6fd1f29afc7081a66ffa02f5277d89ee2e2
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 045dcef9d7..75247eda58 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12563,6 +12563,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]