GNOME Bugzilla – Bug 140819
gtk_tree_view_get_path_at_pos needs to substract the header height before doing anything
Last modified: 2011-02-04 16:11:01 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...
I think you're actually complaining about gtk_tree_view_get_path_at_pos(), right ? This would be an api change.
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...
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...
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.
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).
*** This bug has been marked as a duplicate of 142494 ***