summaryrefslogtreecommitdiff
path: root/gdk/gdkpixmap.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-12-09 20:10:59 +0100
committerAlexander Larsson <alex@localhost.localdomain>2009-04-02 10:14:08 +0200
commit1f5e104495c3925e5225e9e7375d2edbe9df8308 (patch)
treeda2ecb18632166018a5a7ec544264509c2855d9b /gdk/gdkpixmap.c
parent5587130d48daab7189c0268be403f14bebe4c70c (diff)
downloadgtk+-1f5e104495c3925e5225e9e7375d2edbe9df8308.tar.gz
Add _gdk_pixmap_set_as_backing which is a way to get GraphicsExposures on pixmaps reported to the window they are backing store for
Diffstat (limited to 'gdk/gdkpixmap.c')
-rw-r--r--gdk/gdkpixmap.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index 4a67feb4db..3b27eda589 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -225,6 +225,9 @@ gdk_pixmap_finalize (GObject *object)
g_object_unref (obj->impl);
obj->impl = NULL;
+
+ if (obj->backing_for)
+ g_object_unref (obj->backing_for);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -277,6 +280,30 @@ gdk_pixmap_create_from_data (GdkDrawable *drawable,
}
+/* Make GraphicsExposures and NoExposures and similar things report
+ * events on this window. Make sure to ref the pixmap for each operation
+ * that will result in a GraphicsExposure, because the core code will unref
+ * if for each such event. This is so that the pixmap live long enought to
+ * get the events on the window.
+ */
+void
+_gdk_pixmap_set_as_backing (GdkPixmap *pixmap,
+ GdkWindow *window,
+ int x_offset,
+ int y_offset)
+{
+ GdkPixmapObject *private = (GdkPixmapObject *)pixmap;
+
+ if (private->backing_for)
+ g_object_unref (private->backing_for);
+ private->backing_for = window;
+ if (private->backing_for)
+ g_object_ref (private->backing_for);
+ private->backing_x_offset = x_offset;
+ private->backing_y_offset = y_offset;
+
+}
+
static GdkGC *
gdk_pixmap_create_gc (GdkDrawable *drawable,
GdkGCValues *values,