! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
rubberband selection in detailed list view
Status:
CLOSED: FIXED
Severity:
enhancement

Comments

Description Bj 2006-07-06 19:12:31 CEST
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 :>)
Comment 1 Benedikt Meurer editbugs 2006-07-08 13:11:43 CEST
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.
Comment 2 Bj 2006-07-08 14:39:14 CEST
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.
Comment 3 Benedikt Meurer editbugs 2006-07-08 14:41:38 CEST
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.
Comment 4 Bj 2006-07-08 14:46:38 CEST
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.
Comment 5 Benedikt Meurer editbugs 2006-07-09 21:23:34 CEST
Moving to 0.4.0rc1.
Comment 6 Benedikt Meurer editbugs 2006-07-10 09:11:26 CEST
> 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.
Comment 7 Bj 2006-07-10 09:25:19 CEST
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
Comment 8 Benedikt Meurer editbugs 2006-07-10 09:43:23 CEST
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.
Comment 9 Benedikt Meurer editbugs 2006-07-10 09:44:33 CEST
(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...
Comment 10 Bj 2006-07-10 11:04:43 CEST
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
Comment 11 Benedikt Meurer editbugs 2006-07-24 21:01:36 CEST
*** Bug 2066 has been marked as a duplicate of this bug. ***
Comment 12 Benedikt Meurer editbugs 2006-08-06 21:59:45 CEST
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.
Comment 13 Benedikt Meurer editbugs 2006-08-09 15:07:04 CEST
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.
Comment 14 Bj 2006-08-09 16:29:05 CEST
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?
Comment 15 Benedikt Meurer editbugs 2006-08-09 16:31:34 CEST
That's a bug in GtkTreeView, which cannot be worked around from outside.
Comment 16 Benedikt Meurer editbugs 2007-01-20 14:02:23 CET
*** Bug 1464 has been marked as a duplicate of this bug. ***

Bug #1996

Reported by:
Bj
Reported on: 2006-07-06
Last modified on: 2009-07-17
Duplicates (2):
  • 1464 can't select multiple files with mouse in 'Detailed List'
  • 2066 Drag and Select

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Version:
unspecified

Attachments

Possible fix (775 bytes, patch)
2006-07-08 13:11 CEST , Benedikt Meurer
no flags
Additional patch for ExoTreeView (9.99 KB, patch)
2006-08-06 21:59 CEST , Benedikt Meurer
no flags

Additional information