After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 140819 - gtk_tree_view_get_path_at_pos needs to substract the header height before doing anything
gtk_tree_view_get_path_at_pos needs to substract the header height before doi...
Status: RESOLVED DUPLICATE of bug 142494
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.5.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2004-04-22 06:35 UTC by Mariano Suárez-Alvarez
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add dnd -> widget and vice versa conversion (3.18 KB, patch)
2006-12-03 21:15 UTC, Kristian Rietveld
none Details | Review

Description Mariano Suárez-Alvarez 2004-04-22 06:35:09 UTC
Because otherwise it does not do anything very useful, as one has to substract
the header height manually to get at at paths in drag-motion handlers, and the
header height is not exposed. 

See how the filechooser does this, how gtktreeview itself does this, and you'll
notice that they substract the header height at call sites. In the file chooser
this is strictly not needed because it does not have a header on the bookmarks
treeview; it appears evo does not have headers on the treeviews on which it
handles dnd manually, so the problem is not seen there, either.

This will of course break every app which uses the function, but the function is
broken as it is.

I see this on HEAD, but it must be quite old...
Comment 1 Matthias Clasen 2004-04-23 21:01:31 UTC
I think you're actually complaining about gtk_tree_view_get_path_at_pos(), right ?
This would be an api change.
Comment 2 Mariano Suárez-Alvarez 2004-04-24 19:10:17 UTC
Hmm, yes. 

Btw, I prefer 'bug-filing against', or something similar, to 'complaining
about'; as everybody knows, things degrade exponentially fast, and the next step
would be 'whining about', and noone wants to get to that...
Comment 3 Matthias Clasen 2004-05-14 18:01:20 UTC
Actually, we need to clean up the mess of multiple coordinate systems in the
treeview api. gtk_tree_view_get_path_at_pos() behaves as intended. It is
supposed to take x,y relative to the bin window, which doesn't include the headers.
gtk_tree_view_get_dest_row_at_pos() is supposed to be used in connection with
coordinates from DND events, which are relative to the widget. 

What we're missing here API-wise is a way to transform from "DND coordinates" to
"tree window" coordinates... 
Comment 4 Elijah Newren 2004-06-19 18:42:23 UTC
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as
Matthias said he was trying to do himself on IRC and was asking for help with. 
If you see this message, it means I was successful at fixing the borken-ness in
bugzilla :)  Sorry for the spam; just query on this message and delete all
emails you get with this message, since there will probably be a lot.
Comment 5 Kristian Rietveld 2006-12-03 21:15:22 UTC
Created attachment 77605 [details] [review]
add dnd -> widget and vice versa conversion

> What we're missing here API-wise is a way to transform from "DND coordinates" to
> "tree window" coordinates... 

This patch adds such functions.  I've chosen function names such that the match the existing "gtk_tree_view_widget_to_tree_coords" (which I don't really like).
Comment 6 Kristian Rietveld 2007-05-28 21:11:46 UTC

*** This bug has been marked as a duplicate of 142494 ***