--- gtk/gtknotebook.c
+++ gtk/gtknotebook.c
@@ -2934,7 +2934,7 @@
 {
   GtkWidget *widget;
   gint dnd_threshold;
-  GdkRectangle rectangle = { 0, }; /* shut up gcc */
+  GdkRectangle rectangle = { .x = 0, .y = 0 };
   GtkSettings *settings;
   
   widget = GTK_WIDGET (notebook);
@@ -2944,7 +2944,6 @@
   /* we want a large threshold */
   dnd_threshold *= DND_THRESHOLD_MULTIPLIER;
 
-  gdk_window_get_position (notebook->event_window, &rectangle.x, &rectangle.y);
   gdk_drawable_get_size (GDK_DRAWABLE (notebook->event_window), &rectangle.width, &rectangle.height);
 
   rectangle.x -= dnd_threshold;
@@ -3002,7 +3001,7 @@
     return FALSE;
 
   if (page->detachable &&
-      check_threshold (notebook, priv->mouse_x, priv->mouse_y))
+      check_threshold (notebook, event->x, event->y))
     {
       priv->detached_tab = notebook->cur_page;
       priv->during_detach = TRUE;
