From 102d2a36f37e61421135473c403abcb3cd4d12e4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 24 Jun 2020 18:24:12 +0200 Subject: [PATCH] gtkwidget: Avoid use of shadowed flag This is going away, look up whether there is a grab, and whether the widget is within it, instead. --- gtk/gtkwidget.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 9376fc83c9..edfed3a452 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -7573,8 +7573,18 @@ gtk_widget_propagate_state (GtkWidget *widget, if (old_flags != new_flags) { + GtkWindowGroup *window_group; + GtkRoot *root; + GtkWidget *grab; + gboolean shadowed; + g_object_ref (widget); + root = gtk_widget_get_root (widget); + window_group = gtk_window_get_group (GTK_WINDOW (root)); + grab = gtk_window_group_get_current_grab (window_group); + shadowed = grab && grab != widget && !gtk_widget_is_ancestor (widget, grab); + if (!gtk_widget_is_sensitive (widget) && gtk_widget_has_grab (widget)) gtk_grab_remove (widget); @@ -7582,7 +7592,7 @@ gtk_widget_propagate_state (GtkWidget *widget, g_signal_emit (widget, widget_signals[STATE_FLAGS_CHANGED], 0, old_flags); - if (!priv->shadowed && + if (!shadowed && (new_flags & GTK_STATE_FLAG_INSENSITIVE) != (old_flags & GTK_STATE_FLAG_INSENSITIVE)) { guint i, n_devices;