/* Unset window-unfocused since we are no longer inside a toplevel window */
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_WINDOW_UNFOCUSED);
+ if (priv->context)
+ gtk_style_context_set_parent (priv->context, NULL);
g_signal_emit (widget, widget_signals[PARENT_SET], 0, old_parent);
if (toplevel)
data.operation = STATE_CHANGE_REPLACE;
gtk_widget_propagate_state (widget, &data);
+ if (priv->context)
+ gtk_style_context_set_parent (priv->context,
+ gtk_widget_get_style_context (parent));
gtk_widget_reset_style (widget);
g_signal_emit (widget, widget_signals[PARENT_SET], 0, NULL);
gtk_style_context_set_screen (priv->context, screen);
gtk_style_context_set_path (priv->context, path);
+ if (priv->parent)
+ gtk_style_context_set_parent (priv->context,
+ gtk_widget_get_style_context (priv->parent));
}
return widget->priv->context;