[gtk/event-controller-sensitive: 3/4] widget: Reset controllers when going numb
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/event-controller-sensitive: 3/4] widget: Reset controllers when going numb
- Date: Thu, 2 May 2019 19:55:30 +0000 (UTC)
commit af2207bc0b456313b747b868e9660bb565d54642
Author: Matthias Clasen <mclasen redhat com>
Date: Thu May 2 19:12:29 2019 +0000
widget: Reset controllers when going numb
Reset event controllers when their
widget is going insensitive. This is
the expected behavior.
gtk/gtkwidget.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3ae53fdb09..af0b48c8c6 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6363,6 +6363,7 @@ gtk_widget_set_sensitive (GtkWidget *widget,
gboolean sensitive)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
+ GList *l;
g_return_if_fail (GTK_IS_WIDGET (widget));
@@ -6373,6 +6374,13 @@ gtk_widget_set_sensitive (GtkWidget *widget,
priv->sensitive = sensitive;
+ for (l = priv->event_controllers; l; l = l->next)
+ {
+ GtkEventController *controller = l->data;
+
+ gtk_event_controller_reset (controller);
+ }
+
if (priv->parent == NULL
|| gtk_widget_is_sensitive (priv->parent))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]