diff --git a/include/Desktop/compat.h b/include/Desktop/compat.h index 0333803..2baadb5 100644 --- a/include/Desktop/compat.h +++ b/include/Desktop/compat.h @@ -148,6 +148,10 @@ GtkWidget * gtk_separator_new(GtkOrientation orientation); GtkAllocation gtk_widget_get_allocation(GtkWidget * widget); # endif +# if !GTK_CHECK_VERSION(2, 14, 0) +GdkWindow * gtk_widget_get_window(GtkWidget * widget); +# endif + # if !GTK_CHECK_VERSION(2, 12, 0) void gtk_widget_set_tooltip_text(GtkWidget * widget, const gchar * text); # endif diff --git a/src/compat.c b/src/compat.c index c7f4e13..a007bed 100644 --- a/src/compat.c +++ b/src/compat.c @@ -146,6 +146,17 @@ GtkAllocation gtk_widget_get_allocation(GtkWidget * widget) # endif +# if !GTK_CHECK_VERSION(2, 14, 0) +/* gtk_widget_get_window */ +GdkWindow * gtk_widget_get_window(GtkWidget * widget) +{ + if(!gtk_widget_is_realized(widget)) + return NULL; + return widget->window; +} +# endif + + # if !GTK_CHECK_VERSION(2, 12, 0) /* gtk_widget_set_tooltip_text */ void gtk_widget_set_tooltip_text(GtkWidget * widget, const gchar * text)