Index: gdk/gdkinternals.h
===================================================================
--- gdk/gdkinternals.h	(revision 17898)
+++ gdk/gdkinternals.h	(working copy)
@@ -202,6 +202,8 @@ GdkImage *_gdk_image_get_scratch (GdkScr
 				  gint	    *x,
 				  gint	    *y);
 
+GdkPixmap *_gdk_image_get_shm_pixmap (GdkImage *image);
+
 GdkImage *_gdk_drawable_copy_to_image (GdkDrawable  *drawable,
 				       GdkImage     *image,
 				       gint          src_x,
Index: gdk/gdkdisplay.h
===================================================================
--- gdk/gdkdisplay.h	(revision 17898)
+++ gdk/gdkdisplay.h	(working copy)
@@ -181,6 +181,7 @@ void     gdk_display_store_clipboard    
 
 gboolean gdk_display_supports_shapes           (GdkDisplay    *display);
 gboolean gdk_display_supports_input_shapes     (GdkDisplay    *display);
+gboolean gdk_display_supports_shared_pixmaps   (GdkDisplay    *display);
 
 G_END_DECLS
 
Index: gdk/gdkimage.c
===================================================================
--- gdk/gdkimage.c	(revision 17898)
+++ gdk/gdkimage.c	(working copy)
@@ -447,5 +447,27 @@ gdk_image_new (GdkImageType  type,
 				   visual, width, height, -1);
 }
 
+/**
+ * gdk_image_get_shared_pixmap:
+ * @image: A #GdkImage
+ *
+ * Retrieves a #GdkPixmap for this shared image, the #GdkImage must
+ * be of type #GDK_IMAGE_SHARED, the resulting pixmap will be created
+ * with the depth of the image's #GdkVisual.
+ *
+ * Note that the shared pixmap is invalid once the GdkImage holding the
+ * shared image data is destroyed.
+ *
+ * Returns: the #GdkPixmap
+ *
+ * Since: 2.12
+ */
+GdkPixmap *
+gdk_image_get_shared_pixmap (GdkImage *image)
+{
+    return _gdk_image_get_shm_pixmap (image);
+}
+
+
 #define __GDK_IMAGE_C__
 #include "gdkaliasdef.c"
Index: gdk/gdk.symbols
===================================================================
--- gdk/gdk.symbols	(revision 17898)
+++ gdk/gdk.symbols	(working copy)
@@ -459,6 +459,7 @@ gdk_display_supports_clipboard_persisten
 gdk_display_supports_selection_notification
 gdk_display_supports_shapes
 gdk_display_supports_input_shapes
+gdk_display_supports_shared_pixmaps
 #endif
 #endif
 
@@ -769,6 +770,7 @@ gdk_image_get
 gdk_image_set_colormap
 gdk_image_get_colormap
 gdk_image_new
+gdk_image_get_shared_pixmap
 #endif
 #endif
 
Index: gdk/gdkimage.h
===================================================================
--- gdk/gdkimage.h	(revision 17898)
+++ gdk/gdkimage.h	(working copy)
@@ -93,6 +93,8 @@ GdkImage*  gdk_image_new       (GdkImage
 				gint	      width,
 				gint	      height);
 
+GdkPixmap *gdk_image_get_shared_pixmap (GdkImage *image);
+
 #ifndef GDK_DISABLE_DEPRECATED
 GdkImage*  gdk_image_get       (GdkDrawable  *drawable,
 				gint	      x,
Index: gdk/win32/gdkimage-win32.c
===================================================================
--- gdk/win32/gdkimage-win32.c	(revision 17898)
+++ gdk/win32/gdkimage-win32.c	(working copy)
@@ -238,6 +238,14 @@ _gdk_image_new_for_depth (GdkScreen    *
   return image;
 }
 
+GdkPixmap *
+_gdk_image_get_shm_pixmap (GdkImage *image)
+{
+    g_return_val_if_fail (GDK_IS_IMAGE (image));
+    
+    return g_object_ref (image->windowing_data);
+}
+
 GdkImage*
 _gdk_win32_copy_to_image (GdkDrawable    *drawable,
 			  GdkImage       *image,
Index: gdk/win32/gdkdisplay-win32.c
===================================================================
--- gdk/win32/gdkdisplay-win32.c	(revision 17898)
+++ gdk/win32/gdkdisplay-win32.c	(working copy)
@@ -389,3 +389,9 @@ gdk_display_supports_input_shapes (GdkDi
 
   return FALSE;
 }
+
+gboolean 
+gdk_display_supports_shared_pixmaps (GdkDisplay *display)
+{
+  return TRUE;
+}
Index: gdk/x11/gdkdisplay-x11.c
===================================================================
--- gdk/x11/gdkdisplay-x11.c	(revision 17898)
+++ gdk/x11/gdkdisplay-x11.c	(working copy)
@@ -1291,5 +1291,23 @@ gdk_display_supports_input_shapes (GdkDi
 }
 
 
+
+/**
+ * gdk_display_supports_shared_pixmaps:
+ * @display: a #GdkDisplay
+ * 
+ * Returns whether shared memory pixmaps are supported on @display
+ * 
+ * Return value: whether shared pixmaps are supported on @display
+ *
+ * Since: 2.12
+ **/
+gboolean 
+gdk_display_supports_shared_pixmaps (GdkDisplay *display)
+{
+  return GDK_DISPLAY_X11 (display)->have_shm_pixmaps;
+}
+
+
 #define __GDK_DISPLAY_X11_C__
 #include "gdkaliasdef.c"
Index: gdk/x11/gdkimage-x11.c
===================================================================
--- gdk/x11/gdkimage-x11.c	(revision 17898)
+++ gdk/x11/gdkimage-x11.c	(working copy)
@@ -64,6 +64,7 @@ struct _GdkImagePrivateX11
   GdkScreen *screen;
   gpointer x_shm_info;
   Pixmap shm_pixmap;
+  GdkPixmap *shm_gdkpixmap;
 };
 
 static GList *image_list = NULL;
@@ -416,6 +417,23 @@ _gdk_x11_image_get_shm_pixmap (GdkImage 
 #endif    
 }
 
+GdkPixmap *
+_gdk_image_get_shm_pixmap (GdkImage *image)
+{
+  Pixmap     id;
+  GdkImagePrivateX11 *private = PRIVATE_DATA (image);
+  GdkDisplay *display = GDK_SCREEN_DISPLAY (private->screen);
+    
+  if (!private->shm_gdkpixmap &&
+      (id = _gdk_x11_image_get_shm_pixmap (image)) != None)
+    private->shm_gdkpixmap = gdk_pixmap_foreign_new_for_display (display, id);
+
+  if (private->shm_gdkpixmap)
+    g_object_ref (private->shm_gdkpixmap);
+  
+  return private->shm_gdkpixmap;
+}
+
 static GdkImage*
 get_full_image (GdkDrawable    *drawable,
 		gint            src_x,
@@ -732,6 +750,9 @@ gdk_x11_image_destroy (GdkImage *image)
 	  g_free (private->x_shm_info);
 	  private->x_shm_info = NULL;
 
+      if (private->shm_gdkpixmap)
+        g_object_unref (private->shm_gdkpixmap);
+            
 #else /* USE_SHM */
 	  g_error ("trying to destroy shared memory image when gdk was compiled without shared memory support");
 #endif /* USE_SHM */
