summaryrefslogtreecommitdiff
path: root/tests/gtkoffscreenbox.c
diff options
context:
space:
mode:
authorMichael Natterer <mitch@gimp.org>2010-10-14 13:25:23 +0200
committerMichael Natterer <mitch@gimp.org>2010-10-14 13:25:23 +0200
commit9d9742f1e56a331f71c6a46b11ccc765621d46c7 (patch)
tree2a8736e41f6ea1f8ab254bcda86a41c711cd3240 /tests/gtkoffscreenbox.c
parent10c76c1c956c9dee46a6d9e28b9456967d508889 (diff)
downloadgtk+-9d9742f1e56a331f71c6a46b11ccc765621d46c7.tar.gz
Bug 631599 - Allow to use arbitrary surfaces for offscreen windows
Add signal GdkWindow::create-surface which allows to use any surface type as storage for offscreen windows. Test the new signal in tests/gdkoffscreenbox.c
Diffstat (limited to 'tests/gtkoffscreenbox.c')
-rw-r--r--tests/gtkoffscreenbox.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/gtkoffscreenbox.c b/tests/gtkoffscreenbox.c
index fe84db2109..1c19fd996e 100644
--- a/tests/gtkoffscreenbox.c
+++ b/tests/gtkoffscreenbox.c
@@ -234,6 +234,14 @@ offscreen_window_from_parent2 (GdkWindow *window,
offscreen_x, offscreen_y);
}
+static cairo_surface_t *
+gdk_offscreen_box_create_alpha_image_surface (GdkWindow *offscreen,
+ gint width,
+ gint height)
+{
+ return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
+}
+
static void
gtk_offscreen_box_realize (GtkWidget *widget)
{
@@ -323,6 +331,10 @@ gtk_offscreen_box_realize (GtkWidget *widget)
gtk_widget_set_parent_window (offscreen_box->child2, offscreen_box->offscreen_window2);
gdk_offscreen_window_set_embedder (offscreen_box->offscreen_window2,
window);
+
+ g_signal_connect (offscreen_box->offscreen_window2, "create-surface",
+ G_CALLBACK (gdk_offscreen_box_create_alpha_image_surface),
+ offscreen_box);
g_signal_connect (offscreen_box->offscreen_window2, "to-embedder",
G_CALLBACK (offscreen_window_to_parent2), offscreen_box);
g_signal_connect (offscreen_box->offscreen_window2, "from-embedder",