widget: Don't override state data when recursing to children
Writing onto the passed-in GtkStateData could cause changes that would propagate to siblings, as the data was not reset again. By copying the data structure, this is avoided and the proper values are passed to sibling widgets.
This commit is contained in:
@@ -11254,19 +11254,21 @@ gtk_widget_propagate_state (GtkWidget *widget,
|
||||
|
||||
if (GTK_IS_CONTAINER (widget))
|
||||
{
|
||||
data->parent_sensitive = gtk_widget_is_sensitive (widget);
|
||||
GtkStateData child_data = *data;
|
||||
|
||||
child_data.parent_sensitive = gtk_widget_is_sensitive (widget);
|
||||
|
||||
/* Do not propagate focused state further */
|
||||
data->flags &= ~GTK_STATE_FLAG_FOCUSED;
|
||||
child_data.flags &= ~GTK_STATE_FLAG_FOCUSED;
|
||||
|
||||
if (data->use_forall)
|
||||
if (child_data.use_forall)
|
||||
gtk_container_forall (GTK_CONTAINER (widget),
|
||||
(GtkCallback) gtk_widget_propagate_state,
|
||||
data);
|
||||
&child_data);
|
||||
else
|
||||
gtk_container_foreach (GTK_CONTAINER (widget),
|
||||
(GtkCallback) gtk_widget_propagate_state,
|
||||
data);
|
||||
&child_data);
|
||||
}
|
||||
|
||||
/* Trigger state change transitions for the widget */
|
||||
|
||||
Reference in New Issue
Block a user