diff options
author | Benjamin Otte <otte@redhat.com> | 2010-08-15 14:41:29 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-09-26 15:03:00 +0200 |
commit | 0d9d599b50d4b12b0b64f2efaf0ea8f2204eb257 (patch) | |
tree | 31931b2f6cc67c0246fb199e1028220181676b63 /gtk | |
parent | 134683c9beda69925caea7f604b2b3c22abf79d0 (diff) | |
download | gtk+-0d9d599b50d4b12b0b64f2efaf0ea8f2204eb257.tar.gz |
menu: set tearoff background using new background API
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkmenu.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 4765de13ab..9b021e3957 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -1351,8 +1351,9 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu) if (menu->torn_off) { - GdkPixmap *pixmap; GdkWindow *window; + cairo_surface_t *surface; + cairo_pattern_t *pattern; cairo_t *cr; menu->tearoff_active = FALSE; @@ -1362,12 +1363,12 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu) gdk_drawable_get_size (window, &width, &height); - pixmap = gdk_pixmap_new (window, - width, - height, - -1); + surface = gdk_window_create_similar_surface (window, + CAIRO_CONTENT_COLOR, + width, + height); - cr = gdk_cairo_create (pixmap); + cr = cairo_create (surface); /* Let's hope that function never notices we're not passing it a pixmap */ gdk_cairo_set_source_pixmap (cr, window, @@ -1379,8 +1380,11 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu) width, height); - gdk_window_set_back_pixmap (window, pixmap, FALSE); - g_object_unref (pixmap); + pattern = cairo_pattern_create_for_surface (surface); + gdk_window_set_background_pattern (window, pattern); + + cairo_pattern_destroy (pattern); + cairo_surface_destroy (surface); } } |