diff -ur a/gdk/x11//gdkdnd-x11.c b/gdk/x11//gdkdnd-x11.c
--- a/gdk/x11//gdkdnd-x11.c	2010-05-01 22:14:28.000000000 -0500
+++ b/gdk/x11//gdkdnd-x11.c	2012-01-05 22:41:25.000000000 -0600
@@ -614,11 +614,15 @@
       GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
       GdkRegion *input_shape;
 
-      child->shape = _xwindow_get_shape (display_x11->xdisplay,
-                                         child->xid, ShapeBounding);
+      child->shape = NULL;
+      if (gdk_display_supports_shapes (display))
+        child->shape = _xwindow_get_shape (display_x11->xdisplay,
+                                           child->xid, ShapeBounding);
 #ifdef ShapeInput
-      input_shape = _xwindow_get_shape (display_x11->xdisplay,
-                                        child->xid, ShapeInput);
+      input_shape = NULL;
+      if (gdk_display_supports_input_shapes (display))
+        input_shape = _xwindow_get_shape (display_x11->xdisplay,
+                                          child->xid, ShapeInput);
       if (child->shape && input_shape)
         {
           gdk_region_intersect (child->shape, input_shape);
@@ -3879,6 +3883,9 @@
 
   g_return_if_fail (window != NULL);
 
+  if (gdk_window_get_window_type (window) == GDK_WINDOW_OFFSCREEN)
+    return;
+
   base_precache_atoms (display);
 
   if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
diff -ur a/gdk/x11//gdkwindow-x11.c b/gdk/x11//gdkwindow-x11.c
--- a/gdk/x11//gdkwindow-x11.c	2010-05-01 22:14:28.000000000 -0500
+++ b/gdk/x11//gdkwindow-x11.c	2012-01-05 22:36:15.000000000 -0600
@@ -4610,7 +4610,7 @@
 			     window,
 			     shape_type, &rn, &ord);
 
-  if (xrl == NULL || rn == 0)
+  if (rn == 0)
     return gdk_region_new (); /* Empty */
 
   if (ord != YXBanded)
@@ -4683,7 +4683,7 @@
 {
 #if defined(ShapeInput)
   if (!GDK_WINDOW_DESTROYED (window) &&
-      gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)))
+      gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window)))
     return _xwindow_get_shape (GDK_WINDOW_XDISPLAY (window),
 			      GDK_WINDOW_XID (window),
 			      ShapeInput);
