csswidgetnode: Fix container condition for GtkInvisible

... which is a toplevel, but not a container.
This commit is contained in:
Timm Bäder 2016-10-25 16:52:27 +02:00
parent 21a43014ed
commit 6eb3d98de0

View File

@ -94,7 +94,8 @@ gtk_css_widget_node_queue_validate (GtkCssNode *node)
{
GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
if (widget_node->widget && _gtk_widget_is_toplevel (widget_node->widget))
if (widget_node->widget && _gtk_widget_is_toplevel (widget_node->widget) &&
GTK_IS_CONTAINER (widget_node->widget))
widget_node->validate_cb_id = gtk_widget_add_tick_callback (widget_node->widget,
gtk_css_widget_node_queue_callback,
node,
@ -106,7 +107,8 @@ gtk_css_widget_node_dequeue_validate (GtkCssNode *node)
{
GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
if (widget_node->widget && _gtk_widget_is_toplevel (widget_node->widget))
if (widget_node->widget && _gtk_widget_is_toplevel (widget_node->widget) &&
GTK_IS_CONTAINER (widget_node->widget))
gtk_widget_remove_tick_callback (widget_node->widget,
widget_node->validate_cb_id);
}