now that gtk 2.10 finally has rubberband selection in the treeview widget, i would like to see this in thunar (the feature i missed the most in gtk/thunar :>)
Created attachment 652 Possible fix Here's a patch that enables rubberbanding. But GTK+ 2.10 seems to be rather buggy here, as rubberbanding doesn't interact well with DnD.
thank you for the patch! :> the problem you mentioned with DnD is when you select not only files but folders swell, the first selected file is moved/copied into the last selected folder. besides that it seems to work fine, even if it's a bit slower than the rubber banding in the icon view and list view.
ExoIconView is faster because it uses a few simple optimizations for drawing the rubberband drawing, while GtkTreeView uses cairo/Xrender to render the rubberband. You may want to file a bug report to the GNOME bugzilla so the DnD issue gets fixed with 2.10.1.
i think if you could set the action when dragging a file or folder to none when the first file/folder you select, this DnD problem could be "fixed". but i'll file a bug report at gnome bugzilla too. btw, is it possible to start the selection even on free space in the treeview (no files/folder) or would the treeview try to select sth that is not present then? it would make rubber banding behave more like in the list view.
Moving to 0.4.0rc1.
> i think if you could set the action when dragging a file or folder to none when > the first file/folder you select, this DnD problem could be "fixed". Then you'd never be able to drag a selected file/folder. > btw, is it possible to start the selection even on free space in the treeview > (no files/folder) or would the treeview try to select sth that is not present > then? > it would make rubber banding behave more like in the list view. Should be possible, not sure if this is a problem in GtkTreeView.
i think you should be able to drag the file/folder, if you only set the action to none, if the file you click on to start dragging or start the selection is not selected yet. but i could be wrong... i thought about sth like this: if the item you clicked on is selected, set the gtk drag action to move/copy (you could drag the item than) else if the item was not yet selected start the rubber banding with no action. this way you would only have to check on the click if the item is selected. the only "problem" with this would be a single file. you would have to select the file first and then click it again to start the dragging process as the first click would start the rubber banding. anyway, it's of course totally up to you and atm rubber banding isn't officially in thunar anyway. i don't want to complain either, it's just a suggestion ;) btw, could your "simple optimizations" to the rubber banding in icon view make it to gtk or could you try to add it to the treeview rubber banding? thanks
That sounds a lot like the expected behaviour; but of course this is what GtkTreeView is responsible for. Otherwise we'd add a lot of complexity to ThunarDetailsView, and would not even need GtkTreeView 2.10, which I am not in favour of. The "simple optimizations" cannot be applied to GtkTreeView asis, because of the way cell renderers work in trees.
(In reply to comment #8) > The "simple optimizations" cannot be applied to GtkTreeView asis, because of > the way cell renderers work in trees. Which of course doesn't mean that its impossible to improve the performance of the tree view, but I guess the GTK+ guys are waiting for Cairo and X.org to get a performance boost. Dunno...
ok, then these things are for the gtk guys. but there is another thing that seems to be thunar specific and that is if you start the rubber banding selection and move the mouse out of the treeview widget, the selection is discontinued even if you reenter the widget with the cursor. the size of the selection is stuck until you cancel the selection or create a new one. I reported this over at the gtk+ bugzilla too, and the guy who wrote the rubber banding for the treeview says it works fine in his testcase. http://bugzilla.gnome.org/show_bug.cgi?id=346981
*** Bug 2066 has been marked as a duplicate of this bug. ***
Created attachment 711 Additional patch for ExoTreeView Well, the problem is simple: Rubberbanding in GtkTreeView does not interact properly with GTKs own DnD mechanism, which means that when a rubberband selection is started, GTK will still emit "drag-begin" once the drag threshold is reached. This patch works around the bug, and enables rubberband selection in both single and double click mode. You can only start a rubberband selection on an unselected row. On selected rows a drag will be triggered. Note that this is an additional patch, you'll still need to apply the first patch to Thunar.
Committed with revision 22696. 2006-08-09 Benedikt Meurer <benny@xfce.org> * exo/exo-tree-view.c: Add support for rubberband selection in the ExoTreeView class. Bug #1996. 2006-08-09 Benedikt Meurer <benny@xfce.org> * thunar/thunar-details-view.c(thunar_details_view_init): Enable rubberband selection with GTK+ 2.9.0 and above. Bug #1996.
damn nice work! thanks a lot for this. just a question: i can't start the rubber band on white space (no files/folders). is it possible to add this?
That's a bug in GtkTreeView, which cannot be worked around from outside.
*** Bug 1464 has been marked as a duplicate of this bug. ***