widget: Add typecheck-less _is_sensitive

It adds up to a whopping 3% in gtk_widget_pick
This commit is contained in:
Timm Bäder 2019-02-19 08:24:43 +01:00 committed by Benjamin Otte
parent dbf0654e5b
commit a953fd762e
2 changed files with 7 additions and 3 deletions

View File

@ -6481,11 +6481,9 @@ gtk_widget_get_sensitive (GtkWidget *widget)
gboolean
gtk_widget_is_sensitive (GtkWidget *widget)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
return !(priv->state_flags & GTK_STATE_FLAG_INSENSITIVE);
return _gtk_widget_is_sensitive (widget);
}

View File

@ -484,6 +484,12 @@ _gtk_widget_get_last_child (GtkWidget *widget)
return widget->priv->last_child;
}
static inline gboolean
_gtk_widget_is_sensitive (GtkWidget *widget)
{
return !(widget->priv->state_flags & GTK_STATE_FLAG_INSENSITIVE);
}
G_END_DECLS
#endif /* __GTK_WIDGET_PRIVATE_H__ */