Fix build against gtk+ older than 2.21.6.

The gdk_window_get_background_pattern() function copied from GDK and
introduced in commit 0839c10 has a small syntax error and uses a private
API (_gdk_drawable_ref_cairo_surface()). This patch imports the missing
API and fixes the syntax error.

https://bugzilla.gnome.org/show_bug.cgi?id=626583
This commit is contained in:
Thierry Reding 2010-08-19 09:28:46 +02:00 committed by Tomas Frydrych
parent a125b0179a
commit 4544fe7571

View File

@ -2006,6 +2006,14 @@ meta_frames_destroy_event (GtkWidget *widget,
#if !GTK_CHECK_VERSION(2,21,6)
/* Copied from GDK */
static cairo_surface_t *
_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
return GDK_DRAWABLE_GET_CLASS (drawable)->ref_cairo_surface (drawable);
}
static cairo_pattern_t *
gdk_window_get_background_pattern (GdkWindow *window)
{
@ -2033,6 +2041,7 @@ gdk_window_get_background_pattern (GdkWindow *window)
g_object_unref);
}
else
{
pattern =
cairo_pattern_create_rgb (private->bg_color.red / 65535.,
private->bg_color.green / 65535.,