This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API
https://bugzilla.gnome.org/show_bug.cgi?id=610474
This is exposed by overshooting in a HildonPannableArea. Leaking
a GtkTreeRowReference also means leaking the whole model, since
the GtkTreeModel reference count is increased for each row
reference.
Fixes bug #607770 - Leak in GtkTreeView with HildonPannableArea
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.
Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.
Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.
Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.
Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.
Gail and tests are updated as well.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
Initialize event_last_[xy] to out of range coordinates and also update
these values in enter and leave notify. Fix up calls to
update_prelight() from size allocate. Unconditionally doing these calls
caused problems with hover selection. Now we only do this call when
the "width before the expander column" has changed. (Which might be
awkward, but it is the best heuristic I could come up with so far).
Commit again after revert.
Store (x, y) of last motion event. From
gtk_tree_view_adjustment_changed(), call prelight_or_select() so that
the prelight is recalculated. We do the same from
gtk_tree_view_size_allocate() for the case that clicking on an expander
shows new rows that resize the column(s) left of the expander. This
means that the expander is moved horizontally, in such a case the
prelight also has to be reconsidered.
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations. Merge those into the GTK source files.
Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
Rework double click handling in GtkTreeView. We cannot blindly use
the 2BUTTON_PRESS and 3BUTTON_PRESS events. In case a user does two
fast double clicks, we receive a 3BUTTON_PRESS and BUTTON_PRESS. We
cannot easily deduce two double clicks from this.
We have removed the bookkeeping using row references of the last paths
clicked. Instead we monitor event time, (x, y) coordinates and compare
against double-click-time and double-click-distance ourselves.
Store (x, y) of last motion event. From
gtk_tree_view_adjustment_changed(), call prelight_or_select() so that
the prelight is recalculated. We do the same from
gtk_tree_view_size_allocate() for the case that clicking on an expander
shows new rows that resize the column(s) left of the expander. This
means that the expander is moved horizontally, in such a case the
prelight also has to be reconsidered.
Commit 3f306a4042 made it possible for
gtk_tree_view_top_row_to_dy() to be called recursively. (In a different
way than was already guarded for). This caused a single test case in
the scrolling test suite to fail. We now also guard for recursive calls at
the beginning of gtk_tree_view_top_row_to_dy().
This was removed long ago by the patch in bug 101235. On a hindsight,
all other scrollable widgets are processing exposes at this point, which
completely makes sense to me, so I am putting it back.
Such paths (eg. a child node that is collapsed) should be ignored. This
is fixed by checking the return value of _gtk_tree_view_find_node(),
which returns a partial return value (the parent node) when it returns
TRUE. Also added a unit test.
Reorder drawing in gtk_tree_view_bin_expose() so that the tree lines are
drawn after the cells have been drawn. This is because cell-background
is handled in the cell renderer, so the tree lines need to be drawn
after this.
Contrary to what was believed before, do_validate_rows() does need to
queue a normal resize (including a redraw) when it has to. The redraw
is required because of the size of the tree has changed because new
row(s) have been validated.
In validate_visible_area() it was assumed that gtk_tree_path_prev()
would always return the correct path of the preceding node. This is
obviously not true. The if-clause has been removed so that we now
always use _gtk_tree_view_find_path() to get the path from the tree,
node.
gtk_tree_view_enter_notify() now "ignores" the synthesized crossing
events. The synthesized crossing events always have (0, 0) as
coordinates, which messes things up. This patch does not fix all issues,
at least it makes the behavior much more reasonable again. Watch bug
555109 for further discussion on the issue.
Adapt gtk_tree_view_get_path_at_pos() and
gtk_tree_view_get_drag_dest_row() to just return FALSE when bin_window
is NULL and not hit a warning. Makes this case consistent with the tree
view not having a model. Documentation has been updated to clarify
this, unit test has been added.
Fixes bug 539377, based on a patch by Bjorn Lindqvist.
Instead of failing with warning on !tree_view->priv->tree, return
silently when tree_view->priv->model is NULL. Clarified in the
documentation that for invalid paths (and every path is invalid when no
model is set), the function will fail silently although the current
cursor will be unset.
Fixes bugs 498010 and 546005.
gtk_tree_view_discover_dirty_iter() and gtk_tree_view_discover_iter()
have been in the tree forever, but unused since 1.3.8 or so. I guess we
no longer need them, so removed them. Fixes a compiler warning as well.
Previously, do_validate_rows() validated 300 rows per iteration. While
this is usually not problematic, as the typical tree view contains less
than 100 rows. Tree views with a lot of columns or complex cell
renderers could take inacceptably long, like:
- Epiphany's location bar entry completion has multiline and marked up
text in every cell. Validating a single row took ~1.5ms here.
- In the list view in Nautilus, When enabling all columns, validating a
single row would take ~3ms.
With 300 rows per iteration, that made those examples take 500ms/1s in a
signle main loop callback, and this obviously caused responsiveness
problems.
Now the code uses a timer and limits the time for validating rows to
30ms. This can cause less lines to be invalidated per call, so the
function might be called more often, but generally results in more
responsive applications.
GtkFileChooserDefault actually implements a binding signal for
Backspace, to make it go to the parent directory. However,
GtkTreeView was eating our Backspace, and thus the file chooser was
not getting a chance to execute its binding signal.
GtkTreeView implements a Backspace binding itself, which it uses to
move to the parent node of the current cursor node. However, the
binding handler would return TRUE even if there was no parent to the
current node. Now the binding handler only returns TRUE if it
actually changed the cursor.
Additionally, gtk_tree_view_key_press() sees if no bindings handled a
key press; in that case, it re-sends the key press to the treeview's
search entry. However, sending a Backspace to an empty entry makes
the entry beep. Thus, we add a flag that gets set from GtkTreeView's
Backspace binding handler, to tell gtk_tree_view_key_press() when it
should *not* re-emit the key press on the search entry. Sort of,
"yeah, I didn't handle this key press, but I don't want you to send it
to the search entry, either!".
Signed-off-by: Federico Mena Quintero <federico@novell.com>
selecting a cell in a non-sortable column
* gtk/gtktreeview.c (gtk_tree_view_header_focus): Don't grab
focus to a header button if it is not focusable. Problem reported
by Joanmarie Diggs
svn path=/trunk/; revision=22316
2009-01-25 Claudio Saavedra <csaavedra@igalia.com>
* gtk/gtktreeview.c: Use gtk-doc syntax to refer to properties in
the docstrings.
svn path=/trunk/; revision=22213
2008-12-11 Sven Herzberg <sven@imendio.com>
Document the "set-scroll-adjustments" signal
Reviewed by Kristian Rietveld.
* gtk/gtkiconview.c,
* gtk/gtklayout.c,
* gtk/gtktextview.c,
* gtk/gtktreeview.c,
* gtk/gtkviewport.c: added proper documentation for the signal
svn path=/trunk/; revision=21871
2008-11-29 Matthias Clasen <mclasen@redhat.com>
Bug 554453 – "typeahead find" widget of GtkTreeView appears on
wrong monitor in a multi-head environment
* gtk/gtktreeview.c (gtk_tree_view_ensure_interactive_directory):
Make sure the typeahead window follows screen changes of the
treeview. Noticed by Rainer Stransky
svn path=/trunk/; revision=21835
2008-11-29 Federico Mena Quintero <federico@novell.com>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): If tree lines are
enabled, flip them around for the right-to-left case. Fixes
https://bugzilla.novell.com/show_bug.cgi?id=447004. Patch by
Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt>
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=21829
2008-08-12 Michael Natterer <mitch@imendio.com>
* gtk/*.c: consistently chain up using
GTK_FOO_CLASS(parent_class)->bar(instance) instead of
(*GTK_FOO_CLASS(parent_class))->bar(instance).
svn path=/trunk/; revision=21085
2008-08-06 Michael Natterer <mitch@imendio.com>
* gtk/gtkcombobox.c
* gtk/gtkiconview.c
* gtk/gtkrange.c
* gtk/gtkscrolledwindow.c
* gtk/gtktreeview.c: remove CLAMPing from values passed to
gtk_adjustment_set_value() since it does it right now.
svn path=/trunk/; revision=21021
2008-07-11 Kristian Rietveld <kris@gtk.org>
Bug 316087 - Resizing columns is chaotic
* gtk/gtktreeprivate.h: add new member fields.
* gtk/gtktreeview.c (gtk_tree_view_init), (validate_row): set post
validation flag,
(gtk_tree_view_size_allocate_columns): rework the size allocation
mechanism to only recalculate the expand values if the width of the
widget, content or the column configuration has changed,
(gtk_tree_view_size_allocate): move call to size_allocate_columns()
to before the adjustment updates so the proper width is used after
we updated it,
(gtk_tree_view_button_press), (gtk_tree_view_motion_resize_column):
use the column width minus the expand value for the resized width,
(gtk_tree_view_move_column_after): update call to
gtk_tree_view_size_allocate_columns().
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_expand): set use
resized width to FALSE.
* tests/Makefile.am:
* tests/testtreecolumnsizing.c: new interactive test program
for testing column resizing with different column configurations.
svn path=/trunk/; revision=20818
2008-06-19 Johan Dahlin <jdahlin@async.com.br>
* gtk/gtktreeview.c (gtk_tree_view_set_grid_lines),
(gtk_tree_view_set_enable_tree_lines):
gdk_gc_set_dashes expects a list of gint8, not guint8.
svn path=/trunk/; revision=20468
2008-06-08 Kristian Rietveld <kris@gtk.org>
Bug 536730 - memory corruption in gtktreeview
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): first
remove the expand/collapse timeout and node, then free the rbtree.
svn path=/trunk/; revision=20334
2008-06-08 Kristian Rietveld <kris@gtk.org>
Bug 488119 - critical warnings from gtk_tree_view_get_visible_range
* gtk/gtktreeview.c (gtk_tree_view_get_visible_range): only try to
find path if we found valid nodes, return FALSE otherwise. (Patch
from Matthias Clasen).
svn path=/trunk/; revision=20333
2008-05-31 Kristian Rietveld <kris@imendio.com>
Bug 530146 - Setting non-string tooltip with
gtk_tree_view_set_tooltip_column() segfaults
* gtk/gtktreeview.c (gtk_tree_view_set_tooltip_query_cb): use
gtk_tree_model_get_value() and explicitly transform the value to a
string before setting it as tooltip.
svn path=/trunk/; revision=20261
2008-05-28 Kristian Rietveld <kris@imendio.com>
Bug 449625 - crash in gtk_tree_view_real_move_cursor at
gtktreeview.c:9641
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down):
cursor_offset *must* be larger than background height of the cursor
node, not just equal otherwise there is no guarantee there is a next
node.
svn path=/trunk/; revision=20219
2008-05-28 Kristian Rietveld <kris@imendio.com>
Refactor expand/collapse timeout handling (amendment to bug 511217).
* gtk/gtktreeview.c (add_expand_collapse_timeout),
(remove_expand_collapse_timeout): new functions, the remove function
also clears expanded_collapsed_node,
(cancel_arrow_animation): moved to be next to the add/remove timeout
functions,
(gtk_tree_view_unrealize),
(gtk_tree_view_row_deleted),
(gtk_tree_view_set_model),
(cancel_arrow_animation),
(gtk_tree_view_real_expand_row),
(gtk_tree_view_real_collapse_row): use the new add/remove functions.
svn path=/trunk/; revision=20205
* gtk/gtktreeview.c (cancel_arrow_animation): Reset
expanded_collapsed_node when canceling the animation.
Patch by Nicholas Setton.
svn path=/trunk/; revision=20201
2008-03-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_ensure_interactive_directory):
Set window type hint on the search popup. (#522279, Danny Baumann)
svn path=/trunk/; revision=19880
2008-02-13 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreeview.c (gtk_tree_view_stop_rubber_band): only
queue a redraw if the rubber banding has actually been active.
svn path=/trunk/; revision=19556
2008-02-12 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row): guard against people
deleting the row in question in the selection-changed callback.
(#514621, Andreas Koehler).
svn path=/trunk/; revision=19530
2008-02-12 Matthias Clasen <mclasen@redhat.com>
* gtk/*.c: Unify the handling of various "Enter" keysyms
all over the place. (#515047, Christian Persch)
svn path=/trunk/; revision=19528
2008-01-10 Kristian Rietveld <kris@imendio.com>
Fix#477175, reported by Juri Pakaste.
* gtk/gtktreeprivate.h:
* gtk/gtktreeview.c (gtk_tree_view_top_row_to_dy): do not set
tree_view->priv->dy here directly, just calculate the new value
and set it on the adjustment,
(gtk_tree_view_adjustment_changed): add guards to not call
gtk_tree_view_dy_to_top_row() if we are currently in
gtk_tree_view_top_row_to_dy(),
(gtk_tree_view_put): fix coordinate annotation: these are bin_window
coordinates, not tree coordinates,
(gtk_tree_view_real_start_editing): add cast.
* gtk/tests/treeview-scrolling.c: add an assertion for checking the
position of the editable in the "create new row and start editing"
tests.
svn path=/trunk/; revision=19331
2007-10-09 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_page_up_down): make
sure the new cursor node is visible when we are done. (Fixes#472965,
Carlos Garnacho).
svn path=/trunk/; revision=18899
2007-10-09 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_up_down): we should
only "don't move the cursor, but just select the current node" if the
cursor node is actually selectable. (Fixes#483730, reported by
Geoff Bache).
svn path=/trunk/; revision=18898
2007-09-14 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_get_property): the tooltip-column
property getter needs to set an integer, not a boolean. (#476689,
spotted and patch by Christian Persch).
svn path=/trunk/; revision=18818
2007-09-13 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreeview.c (gtk_tree_view_set_toooltip_cell): if cell
is set, always pass in path to gtk_tree_view_get_cell_area() whether
it is NULL or set. Added explanatory comment and added this
side case to the API documentation.
svn path=/trunk/; revision=18812
2007-09-10 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreeview.c (gtk_tree_view_key_press): only start
typeahead search if tree_view has focus (and not one of the column
buttons).
svn path=/trunk/; revision=18779
2007-09-09 Kristian Rietveld <kris@gtk.org>
Reverted r16699:
2006-10-30 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_class_init): change left/right
keybindings to collapse/expand rows instead of moving the focus
cursor. (#105895, Brian Bober and others).
svn path=/trunk/; revision=18768
2007-08-22 Kristian Rietveld <kris@imendio.com>
Do not allow the cursor to go to a separator row. Fixes#441219,
modified patch by Carlos Garnacho.
* gtk/gtktreeview.c (row_is_separator): new inline function
for calling the row-separator-func, made all of gtktreeview.c use
this function instead of calling the func themselves,
(gtk_tree_view_button_press): treat a click on a separator like
a click on empty space,
(gtk_tree_view_update_rubber_band_selection_rage): skip
non-selectable rows,
(search_first_focusable_path),
(gtk_tree_view_focus_to_cursor),
(gtk_tree_view_move_cursor_up_down),
(gtk_tree_view_move_cursor_page_up_down),
(gtk_tree_view_move_cursor_start_end): skip separators,
(gtk_tree_view_real_set_cursor): do not allow setting the cursor
on a separator.
svn path=/trunk/; revision=18672
2007-08-14 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreeview.c (gtk_tree_view_move_cursor_up_down): make
sure we fail keynav if the only item in the list is already selected.
(Fixes#465039, reported by Fernando Herrera).
svn path=/trunk/; revision=18610