[gtk+/wip/garnacho/dnd-grab: 7/13] gtk: Add private gtk_widget_reset_controllers()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/garnacho/dnd-grab: 7/13] gtk: Add private gtk_widget_reset_controllers()
- Date: Mon, 18 Jan 2016 23:01:22 +0000 (UTC)
commit c2e043b7d69eaaa6ad94bbfa2e146030bb110b2f
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jan 13 20:53:54 2016 +0100
gtk: Add private gtk_widget_reset_controllers()
This is a one-shot call that can be called on the places we
know we're taking input away.
gtk/gtkwidget.c | 27 ++++++++++++++++-----------
gtk/gtkwidgetprivate.h | 2 ++
2 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 75935bc..14f6133 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -13006,17 +13006,7 @@ gtk_widget_propagate_state (GtkWidget *widget,
}
if (!gtk_widget_is_sensitive (widget))
- {
- EventControllerData *controller_data;
- GList *l;
-
- /* Reset all controllers */
- for (l = priv->event_controllers; l; l = l->next)
- {
- controller_data = l->data;
- gtk_event_controller_reset (controller_data->controller);
- }
- }
+ gtk_widget_reset_controllers (widget);
if (GTK_IS_CONTAINER (widget))
{
@@ -17596,3 +17586,18 @@ _gtk_widget_consumes_motion (GtkWidget *widget,
return FALSE;
}
+
+void
+gtk_widget_reset_controllers (GtkWidget *widget)
+{
+ EventControllerData *controller_data;
+ GtkWidgetPrivate *priv = widget->priv;
+ GList *l;
+
+ /* Reset all controllers */
+ for (l = priv->event_controllers; l; l = l->next)
+ {
+ controller_data = l->data;
+ gtk_event_controller_reset (controller_data->controller);
+ }
+}
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 18bc980..c54eccc 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -294,6 +294,8 @@ void gtk_widget_set_csd_input_shape (GtkWidget
gboolean gtk_widget_has_size_request (GtkWidget *widget);
+void gtk_widget_reset_controllers (GtkWidget *widget);
+
/* inline getters */
static inline gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]