--- gtk+-2.8.14/gtk/gtkentry.c.carefree-paste	2006-03-13 20:24:41.117676681 +0100
+++ gtk+-2.8.14/gtk/gtkentry.c	2006-03-13 20:25:19.490979283 +0100
@@ -1624,7 +1624,13 @@ gtk_entry_button_press (GtkWidget      *
     }
   else if (event->button == 2 && event->type == GDK_BUTTON_PRESS && entry->editable)
     {
-      priv->insert_pos = tmp_pos;
+      gboolean carefree_paste;
+
+      g_object_get (gtk_widget_get_settings (GTK_WIDGET (entry)),
+                    "gtk-carefree-pointer-paste",
+                    &carefree_paste,
+                    NULL);
+      priv->insert_pos = carefree_paste ? entry->current_pos : tmp_pos;
       gtk_entry_paste (entry, GDK_SELECTION_PRIMARY);
 
       return TRUE;
--- gtk+-2.8.14/gtk/gtksettings.c.carefree-paste	2006-03-13 20:24:41.119676332 +0100
+++ gtk+-2.8.14/gtk/gtksettings.c	2006-03-13 20:25:19.492978934 +0100
@@ -78,7 +78,8 @@ enum {
   PROP_CURSOR_THEME_NAME,
   PROP_CURSOR_THEME_SIZE,
 #endif
-  PROP_ALTERNATIVE_BUTTON_ORDER
+  PROP_ALTERNATIVE_BUTTON_ORDER,
+  PROP_CAREFREE_POINTER_PASTE
 };
 
 
@@ -396,6 +397,15 @@ gtk_settings_class_init (GtkSettingsClas
 								   GTK_PARAM_READWRITE),
                                              NULL);
   g_assert (result == PROP_ALTERNATIVE_BUTTON_ORDER);
+
+  result = settings_install_property_parser (class,
+                                             g_param_spec_boolean ("gtk-carefree-pointer-paste",
+								   P_("Carefree pointer paste"),
+								   P_("Whether paste with middle pointer button occurs at current cursor poisition"),
+								   FALSE,
+								   G_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_CAREFREE_POINTER_PASTE);
 }
 
 static void
--- gtk+-2.8.14/gtk/gtktextview.c.carefree-paste	2006-03-13 20:24:41.123675634 +0100
+++ gtk+-2.8.14/gtk/gtktextview.c	2006-03-13 20:25:19.496978236 +0100
@@ -3998,7 +3998,20 @@ gtk_text_view_button_press_event (GtkWid
       else if (event->button == 2)
         {
           GtkTextIter iter;
+          gboolean carefree_paste;
 
+          g_object_get (gtk_widget_get_settings (GTK_WIDGET (text_view)),
+                        "gtk-carefree-pointer-paste",
+                        &carefree_paste,
+                        NULL);
+          if (carefree_paste)
+            {
+              gtk_text_buffer_paste_clipboard (get_buffer (text_view),
+					       gtk_widget_get_clipboard (widget, GDK_SELECTION_PRIMARY),
+					       NULL,
+					       text_view->editable);
+              return TRUE;
+            }
           gtk_text_layout_get_iter_at_pixel (text_view->layout,
                                              &iter,
                                              event->x + text_view->xoffset,
