Index: gdk/gdkevents.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkevents.c,v
retrieving revision 1.72
diff -u -p -u -r1.72 gdkevents.c
--- gdk/gdkevents.c	16 Mar 2005 03:17:27 -0000	1.72
+++ gdk/gdkevents.c	26 Mar 2005 23:51:48 -0000
@@ -1022,7 +1022,7 @@ gdk_synthesize_click (GdkDisplay *displa
 		      gint	  nclicks)
 {
   GdkEvent temp_event;
-  
+
   g_return_if_fail (event != NULL);
   
   temp_event = *event;
@@ -1040,9 +1040,9 @@ _gdk_event_button_generate (GdkDisplay *
       (event->button.button == display->button_number[1]) &&
       (ABS (event->button.x - display->button_x[1]) <= display->double_click_distance) &&
       (ABS (event->button.y - display->button_y[1]) <= display->double_click_distance))
-{
+    {
       gdk_synthesize_click (display, event, 3);
-            
+      
       display->button_click_time[1] = 0;
       display->button_click_time[0] = 0;
       display->button_window[1] = NULL;
@@ -1060,16 +1060,30 @@ _gdk_event_button_generate (GdkDisplay *
     {
       gdk_synthesize_click (display, event, 2);
       
-      display->button_click_time[1] = display->button_click_time[0];
-      display->button_click_time[0] = event->button.time;
-      display->button_window[1] = display->button_window[0];
-      display->button_window[0] = event->button.window;
-      display->button_number[1] = display->button_number[0];
-      display->button_number[0] = event->button.button;
-      display->button_x[1] = display->button_x[0];
-      display->button_x[0] = event->button.x;
-      display->button_y[1] = display->button_y[0];
-      display->button_y[0] = event->button.y;
+      if (gdk_window_get_triple_clicks (event->button.window))
+	{
+	  display->button_click_time[1] = display->button_click_time[0];
+	  display->button_click_time[0] = event->button.time;
+	  display->button_window[1] = display->button_window[0];
+	  display->button_window[0] = event->button.window;
+	  display->button_number[1] = display->button_number[0];
+	  display->button_number[0] = event->button.button;
+	  display->button_x[1] = display->button_x[0];
+	  display->button_x[0] = event->button.x;
+	  display->button_y[1] = display->button_y[0];
+	  display->button_y[0] = event->button.y;
+	}
+      else
+	{
+	  display->button_click_time[1] = 0;
+	  display->button_click_time[0] = 0;
+	  display->button_window[1] = NULL;
+	  display->button_window[0] = 0;
+	  display->button_number[1] = -1;
+	  display->button_number[0] = -1;
+	  display->button_x[0] = display->button_x[1] = 0;
+	  display->button_y[0] = display->button_y[1] = 0;
+	}
     }
   else
     {
Index: gdk/gdkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkwindow.c,v
retrieving revision 1.169
diff -u -p -u -r1.169 gdkwindow.c
--- gdk/gdkwindow.c	18 Mar 2005 01:23:22 -0000	1.169
+++ gdk/gdkwindow.c	26 Mar 2005 23:51:48 -0000
@@ -232,6 +232,7 @@ gdk_window_init (GdkWindowObject *window
   window->state = GDK_WINDOW_STATE_WITHDRAWN;
   
   window->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
+  window->triple_clicks = TRUE;
 }
 
 static void
@@ -2915,5 +2916,42 @@ gdk_window_foreign_new (GdkNativeWindow 
   return gdk_window_foreign_new_for_display (gdk_display_get_default (), anid);
 }
 
+/**
+ * gdk_window_set_triple_clicks:
+ * @window: a #GdkWindow
+ * @gboolean: whether GDK_3BUTTON_PRESS events are generated for @window
+ *
+ * Sets whether GDK_3BUTTON_PRESS events are generated for @window
+ *
+ * Since: 2.6
+ **/
+void
+gdk_window_set_triple_clicks (GdkWindow *window,
+                             gboolean triple_clicks)
+{
+  g_return_if_fail (GDK_IS_WINDOW (window));
+
+  ((GdkWindowObject *)window)->triple_clicks = triple_clicks;
+}
+
+/**
+ * gdk_window_get_triple_clicks:
+ * @window: a #GdkWindow
+ *
+ * Returns whether GDK_3BUTTON_PRESS events are generated for @window
+ *
+ * Return value: Whether GDK_3BUTTON_PRESS events are generated for @window
+ *
+ * Since: 2.4
+ **/
+gboolean
+gdk_window_get_triple_clicks (GdkWindow *window)
+{
+  g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
+
+  return ((GdkWindowObject *)window)->triple_clicks;
+}
+
 #define __GDK_WINDOW_C__
 #include "gdkaliasdef.c"
+
Index: gdk/gdkwindow.h
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkwindow.h,v
retrieving revision 1.51
diff -u -p -u -r1.51 gdkwindow.h
--- gdk/gdkwindow.h	11 Jul 2004 13:26:57 -0000	1.51
+++ gdk/gdkwindow.h	26 Mar 2005 23:51:48 -0000
@@ -263,6 +263,8 @@ struct _GdkWindowObject
 
   guint accept_focus : 1;
   guint focus_on_map : 1;
+
+  guint triple_clicks : 1;
   
   GdkEventMask event_mask;
 };
@@ -333,6 +335,9 @@ void          gdk_window_remove_filter  
 void          gdk_window_scroll                (GdkWindow *window,
                                                 gint       dx,
                                                 gint       dy);
+void	      gdk_window_set_triple_clicks     (GdkWindow *window,
+						gboolean triple_clicks);
+gboolean      gdk_window_get_triple_clicks     (GdkWindow *window);
 
 /* 
  * This allows for making shaped (partially transparent) windows
Index: gtk/gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.440
diff -u -p -u -r1.440 gtktreeview.c
--- gtk/gtktreeview.c	26 Mar 2005 05:49:14 -0000	1.440
+++ gtk/gtktreeview.c	26 Mar 2005 23:51:49 -0000
@@ -1527,6 +1527,7 @@ gtk_tree_view_realize (GtkWidget *widget
 
   widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
 				   &attributes, attributes_mask);
+  gdk_window_set_triple_clicks (widget->window, FALSE);
   gdk_window_set_user_data (widget->window, widget);
 
   /* Make the window for the tree */
@@ -1545,6 +1546,7 @@ gtk_tree_view_realize (GtkWidget *widget
 
   tree_view->priv->bin_window = gdk_window_new (widget->window,
 						&attributes, attributes_mask);
+  gdk_window_set_triple_clicks (tree_view->priv->bin_window, FALSE);
   gdk_window_set_user_data (tree_view->priv->bin_window, widget);
 
   /* Make the column header window */
@@ -1562,6 +1564,7 @@ gtk_tree_view_realize (GtkWidget *widget
 
   tree_view->priv->header_window = gdk_window_new (widget->window,
 						   &attributes, attributes_mask);
+  gdk_window_set_triple_clicks (tree_view->priv->header_window, FALSE);
   gdk_window_set_user_data (tree_view->priv->header_window, widget);
 
 
