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.
This commit is contained in:
Carlos Garnacho 2016-01-13 20:53:54 +01:00
parent e4f5e31b8b
commit 2b703b61cf
2 changed files with 18 additions and 11 deletions

View File

@ -12834,17 +12834,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))
{
@ -17424,3 +17414,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);
}
}

View File

@ -292,6 +292,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