Commit 5a2ebedc authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Kristian Rietveld

if we use pointers, we should free the previous pointer first (if it

Mon Dec  3 21:15:59 2001  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
        we use pointers, we should free the previous pointer first (if
        it exists), before we set a new pointer. (#64726)

        * gtk/gtktreeprivate.h: get rid of cursor_drag

        * gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
        for cursor_drag
        (gtk_tree_view_bin_expose): don't directly return in the while
        loop
        (gtk_tree_view_class_init): indentend expanders by default
        (gtk_tree_view_header_focus): only give the button focus
        if it's clickable, visible and the column is reorderable
        (#65539)

        * gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
        create and free cursor
parent 6b387750
Mon Dec 3 21:15:59 2001 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
we use pointers, we should free the previous pointer first (if
it exists), before we set a new pointer. (#64726)
* gtk/gtktreeprivate.h: get rid of cursor_drag
* gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
for cursor_drag
(gtk_tree_view_bin_expose): don't directly return in the while
loop
(gtk_tree_view_class_init): indentend expanders by default
(gtk_tree_view_header_focus): only give the button focus
if it's clickable, visible and the column is reorderable
(#65539)
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
create and free cursor
Mon Dec 3 10:23:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_size_request): Fix
......
Mon Dec 3 21:15:59 2001 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
we use pointers, we should free the previous pointer first (if
it exists), before we set a new pointer. (#64726)
* gtk/gtktreeprivate.h: get rid of cursor_drag
* gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
for cursor_drag
(gtk_tree_view_bin_expose): don't directly return in the while
loop
(gtk_tree_view_class_init): indentend expanders by default
(gtk_tree_view_header_focus): only give the button focus
if it's clickable, visible and the column is reorderable
(#65539)
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
create and free cursor
Mon Dec 3 10:23:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_size_request): Fix
......
Mon Dec 3 21:15:59 2001 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
we use pointers, we should free the previous pointer first (if
it exists), before we set a new pointer. (#64726)
* gtk/gtktreeprivate.h: get rid of cursor_drag
* gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
for cursor_drag
(gtk_tree_view_bin_expose): don't directly return in the while
loop
(gtk_tree_view_class_init): indentend expanders by default
(gtk_tree_view_header_focus): only give the button focus
if it's clickable, visible and the column is reorderable
(#65539)
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
create and free cursor
Mon Dec 3 10:23:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_size_request): Fix
......
Mon Dec 3 21:15:59 2001 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
we use pointers, we should free the previous pointer first (if
it exists), before we set a new pointer. (#64726)
* gtk/gtktreeprivate.h: get rid of cursor_drag
* gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
for cursor_drag
(gtk_tree_view_bin_expose): don't directly return in the while
loop
(gtk_tree_view_class_init): indentend expanders by default
(gtk_tree_view_header_focus): only give the button focus
if it's clickable, visible and the column is reorderable
(#65539)
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
create and free cursor
Mon Dec 3 10:23:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_size_request): Fix
......
Mon Dec 3 21:15:59 2001 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
we use pointers, we should free the previous pointer first (if
it exists), before we set a new pointer. (#64726)
* gtk/gtktreeprivate.h: get rid of cursor_drag
* gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
for cursor_drag
(gtk_tree_view_bin_expose): don't directly return in the while
loop
(gtk_tree_view_class_init): indentend expanders by default
(gtk_tree_view_header_focus): only give the button focus
if it's clickable, visible and the column is reorderable
(#65539)
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
create and free cursor
Mon Dec 3 10:23:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_size_request): Fix
......
Mon Dec 3 21:15:59 2001 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
we use pointers, we should free the previous pointer first (if
it exists), before we set a new pointer. (#64726)
* gtk/gtktreeprivate.h: get rid of cursor_drag
* gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
for cursor_drag
(gtk_tree_view_bin_expose): don't directly return in the while
loop
(gtk_tree_view_class_init): indentend expanders by default
(gtk_tree_view_header_focus): only give the button focus
if it's clickable, visible and the column is reorderable
(#65539)
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
create and free cursor
Mon Dec 3 10:23:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_size_request): Fix
......
Mon Dec 3 21:15:59 2001 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreedatalist.c (_gtk_tree_data_list_value_to_node): if
we use pointers, we should free the previous pointer first (if
it exists), before we set a new pointer. (#64726)
* gtk/gtktreeprivate.h: get rid of cursor_drag
* gtk/gtktreeview.c (gtk_tree_view_unrealize): remove check
for cursor_drag
(gtk_tree_view_bin_expose): don't directly return in the while
loop
(gtk_tree_view_class_init): indentend expanders by default
(gtk_tree_view_header_focus): only give the button focus
if it's clickable, visible and the column is reorderable
(#65539)
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_realize_button):
create and free cursor
Mon Dec 3 10:23:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalendar.c (gtk_calendar_size_request): Fix
......
......@@ -196,12 +196,18 @@ _gtk_tree_data_list_value_to_node (GtkTreeDataList *list,
list->data.v_double = g_value_get_double (value);
break;
case G_TYPE_STRING:
if (list->data.v_pointer)
g_free (list->data.v_pointer);
list->data.v_pointer = g_value_dup_string (value);
break;
case G_TYPE_OBJECT:
if (list->data.v_pointer)
g_object_unref (list->data.v_pointer);
list->data.v_pointer = g_value_dup_object (value);
break;
case G_TYPE_BOXED:
if (list->data.v_pointer)
g_boxed_free (G_VALUE_TYPE (value), list->data.v_pointer);
list->data.v_pointer = g_value_dup_boxed (value);
break;
default:
......
......@@ -117,7 +117,6 @@ struct _GtkTreeViewPrivate
GtkTreeRowReference *cursor;
/* Column Resizing */
GdkCursor *cursor_drag;
GdkGC *xor_gc;
gint drag_pos;
gint x_drag;
......
......@@ -616,7 +616,7 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
g_param_spec_boolean ("indent_expanders",
_("Indent Expanders"),
_("Make the expanders indented."),
FALSE,
TRUE,
G_PARAM_READABLE));
/* Signals */
widget_class->set_scroll_adjustments_signal =
......@@ -1349,12 +1349,6 @@ gtk_tree_view_unrealize (GtkWidget *widget)
tree_view->priv->drag_highlight_window = NULL;
}
if (tree_view->priv->cursor_drag)
{
gdk_cursor_destroy (tree_view->priv->cursor_drag);
tree_view->priv->cursor_drag = NULL;
}
if (tree_view->priv->xor_gc)
{
gdk_gc_destroy (tree_view->priv->xor_gc);
......@@ -2835,9 +2829,8 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
node = tree->parent_node;
tree = tree->parent_tree;
if (tree == NULL)
/* we've run out of tree. It's okay to return though, as
* we'd only break out of the while loop below. */
return TRUE;
/* we should go to done to free some memory */
goto done;
has_parent = gtk_tree_model_iter_parent (tree_view->priv->model,
&iter,
&parent_iter);
......@@ -2852,6 +2845,7 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
}
while (y_offset < event->area.height);
done:
if (cursor_path)
gtk_tree_path_free (cursor_path);
......@@ -3993,6 +3987,8 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view,
while (last_column)
{
if (GTK_WIDGET_CAN_FOCUS (GTK_TREE_VIEW_COLUMN (last_column->data)->button) &&
GTK_TREE_VIEW_COLUMN (last_column->data)->clickable &&
GTK_TREE_VIEW_COLUMN (last_column->data)->reorderable &&
GTK_TREE_VIEW_COLUMN (last_column->data)->visible)
break;
last_column = last_column->prev;
......@@ -4007,6 +4003,8 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view,
while (first_column)
{
if (GTK_WIDGET_CAN_FOCUS (GTK_TREE_VIEW_COLUMN (first_column->data)->button) &&
GTK_TREE_VIEW_COLUMN (first_column->data)->clickable &&
GTK_TREE_VIEW_COLUMN (last_column->data)->reorderable &&
GTK_TREE_VIEW_COLUMN (first_column->data)->visible)
break;
first_column = first_column->next;
......
......@@ -929,7 +929,6 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
GDK_KEY_PRESS_MASK);
attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y;
attr.cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
tree_view->priv->cursor_drag = attr.cursor;
attr.y = 0;
attr.width = TREE_VIEW_DRAG_WIDTH;
......@@ -942,6 +941,8 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
gdk_window_set_user_data (column->window, tree_view);
gtk_tree_view_column_update_button (column);
gdk_cursor_unref (attr.cursor);
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment