Index: gtk/gtkdnd.c
===================================================================
--- gtk/gtkdnd.c	(revision 17021)
+++ gtk/gtkdnd.c	(working copy)
@@ -33,6 +33,12 @@
 
 #include "gdk/gdkkeysyms.h"
 
+#ifdef GDK_WINDOWING_X11
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+#include "gdk/x11/gdkx.h"
+#endif
+
 #include "gtkdnd.h"
 #include "gtkiconfactory.h"
 #include "gtkicontheme.h"
@@ -393,6 +399,63 @@ gtk_drag_get_ipc_widget (GtkWidget *widg
 }
 
 
+#ifdef GDK_WINDOWING_X11
+void
+grab_dnd_keys (GdkWindow *window)
+{
+  guint i;
+  static gint keyvals[] = {
+    XK_Escape, 
+    XK_space, XK_KP_Space,
+    XK_Return, XK_KP_Enter,
+    XK_Up, XK_Down, XK_Left, XK_Right,
+    XK_KP_Up, XK_KP_Down, XK_KP_Left, XK_KP_Right
+  };
+
+  g_return_if_fail (GDK_IS_WINDOW (window));
+  g_return_if_fail (!g_object_get_data (G_OBJECT (window), 
+				        "gtk-dnd-keys-grabbed"));
+
+  gdk_error_trap_push ();
+
+  for (i = 0; i < G_N_ELEMENTS (keyvals); ++i)
+    XGrabKey (GDK_WINDOW_XDISPLAY (window),
+	      keyvals[i], AnyModifier,
+	      GDK_WINDOW_XID (window),
+	      FALSE,
+	      GrabModeAsync,
+	      GrabModeAsync);
+
+  gdk_flush ();
+  gdk_error_trap_pop ();
+
+  g_object_set_data (G_OBJECT (window),
+		     "gtk-dnd-keys-grabbed",
+		     GINT_TO_POINTER (TRUE));
+}
+
+void
+ungrab_dnd_keys (GdkWindow *window)
+{
+  g_return_if_fail (GDK_IS_WINDOW (window));
+
+  if (g_object_get_data (G_OBJECT (window), "gtk-dnd-keys-grabbed"))
+    {
+      gdk_error_trap_push ();
+
+      XUngrabKey (GDK_WINDOW_XDISPLAY (window),
+		  AnyKey, AnyModifier,
+		  GDK_WINDOW_XID (window));
+
+      gdk_flush ();
+      gdk_error_trap_pop ();
+
+      g_object_set_data (G_OBJECT (window), "gtk-dnd-keys-grabbed", NULL);
+    }
+}
+#endif
+
+
 /***************************************************************
  * gtk_drag_release_ipc_widget:
  *     Releases widget retrieved with gtk_drag_get_ipc_widget ()
@@ -408,6 +471,9 @@ gtk_drag_release_ipc_widget (GtkWidget *
   GdkScreen *screen = gtk_widget_get_screen (widget);
   GSList *drag_widgets = g_object_get_data (G_OBJECT (screen),
 					    "gtk-dnd-ipc-widgets");
+#ifdef GDK_WINDOWING_X11
+  ungrab_dnd_keys (widget->window);
+#endif
   if (window->group)
     gtk_window_group_remove_window (window->group, window);
   drag_widgets = g_slist_prepend (drag_widgets, widget);
@@ -2207,8 +2273,12 @@ gtk_drag_begin_internal (GtkWidget      
       return NULL;
     }
 
+#ifdef GDK_WINDOWING_X11
+  grab_dnd_keys (ipc_widget->window);
+#else
   gdk_keyboard_grab (ipc_widget->window, FALSE, time);
-    
+#endif
+
   /* We use a GTK grab here to override any grabs that the widget
    * we are dragging from might have held
    */
@@ -3945,7 +4015,11 @@ gtk_drag_end (GtkDragSourceInfo *info, g
 					info);
 
   gdk_display_pointer_ungrab (display, time);
+#ifdef GDK_WINDOWING_X11
+  ungrab_dnd_keys (info->ipc_widget->window);
+#else
   gdk_display_keyboard_ungrab (display, time);
+#endif
   gtk_grab_remove (info->ipc_widget);
 
   /* Send on a release pair to the original 
Index: gtk/gtkentry.c
===================================================================
--- gtk/gtkentry.c	(revision 17021)
+++ gtk/gtkentry.c	(working copy)
@@ -3155,7 +3155,7 @@ recompute_idle_func (gpointer data)
 
   entry->recompute_idle = 0;
   
-  if (gtk_widget_has_screen (GTK_WIDGET (entry)))
+  if (GTK_WIDGET_REALIZED (entry))
     {
       gtk_entry_adjust_scroll (entry);
       gtk_entry_queue_draw (entry);
Index: configure.in
===================================================================
--- configure.in	(revision 17021)
+++ configure.in	(working copy)
@@ -1520,6 +1520,7 @@ AC_SUBST(GTK_XIM_FLAGS)
 ################################################################
 
 AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
+CUPS_CONFIG=no
 if test "x$CUPS_CONFIG" != "xno"; then
   CUPS_CFLAGS=`cups-config --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
   CUPS_LIBS=`cups-config --libs`
