mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-24 15:29:45 +03:00
Fix gtk compat layer to not segfault on old versions of GTK.
svn path=/trunk/netsurf/; revision=10593
This commit is contained in:
parent
89683af529
commit
2d4222def8
@ -24,18 +24,20 @@
|
||||
|
||||
gboolean nsgtk_widget_has_focus(GtkWidget *widget)
|
||||
{
|
||||
GValue v;
|
||||
g_object_get_property(G_OBJECT(widget), "is-focus", &v);
|
||||
|
||||
return g_value_get_boolean(&v);
|
||||
#if GTK_CHECK_VERSION(2,20,0)
|
||||
return gtk_widget_has_focus(widget);
|
||||
#else
|
||||
return GTK_WIDGET_HAS_FOCUS(widget);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean nsgtk_widget_get_visible(GtkWidget *widget)
|
||||
{
|
||||
GValue v;
|
||||
g_object_get_property(G_OBJECT(widget), "visible", &v);
|
||||
|
||||
return g_value_get_boolean(&v);
|
||||
#if GTK_CHECK_VERSION(2,20,0)
|
||||
return gtk_widget_get_visible(widget);
|
||||
#else
|
||||
return GTK_WIDGET_VISIBLE(widget);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean nsgtk_widget_get_realized(GtkWidget *widget)
|
||||
|
Loading…
Reference in New Issue
Block a user