gtk+ r19333 - in trunk: . gtk



Author: kristian
Date: Thu Jan 10 10:13:28 2008
New Revision: 19333
URL: http://svn.gnome.org/viewvc/gtk+?rev=19333&view=rev

Log:
2008-01-10  Kristian Rietveld  <kris imendio com>

	* gtk/gtktreeview.c (gtk_tree_view_motion_draw_column_motion_arrow),
	(_gtk_tree_view_column_start_drag): fully initialize GdkWindowAttr to
	avoid valgrind warnings.  (#507751, patch from Christian Persch).



Modified:
   trunk/ChangeLog
   trunk/gtk/gtktreeview.c

Modified: trunk/gtk/gtktreeview.c
==============================================================================
--- trunk/gtk/gtktreeview.c	(original)
+++ trunk/gtk/gtktreeview.c	Thu Jan 10 10:13:28 2008
@@ -3333,6 +3333,10 @@
 
 	  attributes.window_type = GDK_WINDOW_CHILD;
 	  attributes.wclass = GDK_INPUT_OUTPUT;
+          attributes.x = tree_view->priv->drag_column_x;
+          attributes.y = 0;
+	  width = attributes.width = tree_view->priv->drag_column->button->allocation.width;
+	  height = attributes.height = tree_view->priv->drag_column->button->allocation.height;
 	  attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
 	  attributes.colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_view));
 	  attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK;
@@ -3340,11 +3344,6 @@
 	  tree_view->priv->drag_highlight_window = gdk_window_new (tree_view->priv->header_window, &attributes, attributes_mask);
 	  gdk_window_set_user_data (tree_view->priv->drag_highlight_window, GTK_WIDGET (tree_view));
 
-	  width = tree_view->priv->drag_column->button->allocation.width;
-	  height = tree_view->priv->drag_column->button->allocation.height;
-	  gdk_window_move_resize (tree_view->priv->drag_highlight_window,
-				  tree_view->priv->drag_column_x, 0, width, height);
-
 	  mask = gdk_pixmap_new (tree_view->priv->drag_highlight_window, width, height, 1);
 	  gc = gdk_gc_new (mask);
 	  col.pixel = 1;
@@ -3400,6 +3399,8 @@
 	  attributes.colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_view));
 	  attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK;
 	  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+          attributes.x = x;
+          attributes.y = y;
 	  attributes.width = width;
 	  attributes.height = height;
 	  tree_view->priv->drag_highlight_window = gdk_window_new (gtk_widget_get_root_window (widget),
@@ -3474,6 +3475,8 @@
 	  attributes.colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_view));
 	  attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK;
 	  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+          attributes.x = x;
+          attributes.y = y;
 	  attributes.width = width;
 	  attributes.height = height;
 	  tree_view->priv->drag_highlight_window = gdk_window_new (NULL, &attributes, attributes_mask);
@@ -9340,6 +9343,10 @@
 
       attributes.window_type = GDK_WINDOW_CHILD;
       attributes.wclass = GDK_INPUT_OUTPUT;
+      attributes.x = column->button->allocation.x;
+      attributes.y = 0;
+      attributes.width = column->button->allocation.width;
+      attributes.height = column->button->allocation.height;
       attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
       attributes.colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_view));
       attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK;
@@ -9382,12 +9389,6 @@
   gtk_propagate_event (column->button, send_event);
   gdk_event_free (send_event);
 
-  gdk_window_move_resize (tree_view->priv->drag_window,
-			  column->button->allocation.x,
-			  0,
-			  column->button->allocation.width,
-			  column->button->allocation.height);
-
   /* Kids, don't try this at home */
   g_object_ref (column->button);
   gtk_container_remove (GTK_CONTAINER (tree_view), column->button);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]