GNOME Bugzilla – Bug 342357
Unxepected file opening when clicking directory arrow in list mode
Last modified: 2008-05-10 13:22:30 UTC
Please describe the problem: When pressing the arrow to show direcory contents in list view, any marked files or directories are sometimes opened. This happens when the right side of an arrow present in a sublevel of another directory is clicked in single click mode, or any arrow in double click mode is double clicked. Steps to reproduce: 1. Open nautilus in list view. 2. Mark any file or directory. If nautilus is set to single click to activate: 3. Unfold a directory containing other direcories. 4. Click slightly to the right of a directory arrow inside the opened sublevel (arrow still marked). If nautilus is set to double click to activate: 3. Doubleclick on any list view directory arrow at any point. Actual results: The directory unfolds and any files or directories that marked are opened. Expected results: The directory unfolds, no files or directories opened. Does this happen every time? Yes. Other information: This does not happen with directory arrows in the tree sidebar. The behaviour differs significantly between single and double click mode, in single click mode only a part of the clickable surface on an arrow has the bug.
This bug is still here in nautilus 2.16.
Confirming (though still using nautilus 2.14.1). This is very annoying.
Still in 2.20. If this bug is difficult to fix, would it be possible to just make the expander only activate/highlight if the cursor is exactly inside it? Having a bigger target is very nice, but having an area look like the taget when activating will have unintended side-effects is quite annoying. It's especially bad if you have many files selected when you expand - 100 odt files selected when you click a little to the right of the expander and a hundred OOo windows open, which can take quite long on older hardware. Thanks for nautilus btw - It's by far my favorite file manager.
Confirming with 2.22.0.
*** Bug 514975 has been marked as a duplicate of this bug. ***
Created attachment 109309 [details] [review] Adjusted expander size calculation. on_expander boolean was false on some causes where it should have been true (ie. clicking on the right edge of the expander). I've found the following approach and it seems to be working fine. Needs testing on various GTK+ themes though.. http://mail.gnome.org/archives/gtk-list/2004-May/msg00178.html
Thanks for your work! I tested the patch, but it does not solve the bug if we're using double click policy. I think you have to apply the same check for the click on the expander in the GDK_2BUTTON_PRESS case (some lines before your patch) and inhibit file activation in that case.
Created attachment 109327 [details] [review] Second version. Now the check is done regardless of the clicking policy and file activation is prevented with double click.
I tested the second version of the patch with single- and double-click policy on Ubuntu Hardy with nautilus version 2.22.2-0ubuntu3 and the Ubuntu Studio theme: patch solves the issue for me. Thanks for the patch, this bug used to drove me mad on bad days.
Johannes: thanks for testing!
Comment on attachment 109327 [details] [review] Second version. >+ gtk_widget_style_get(widget, "expander-size", &expander_size, >+ on_expander = (event->x <= gtk_tree_path_get_depth(path) * expander_size); Please always put a space before braces. Other than this, the patch looks fine to me (and it works good too). Let's wait for Christian's review.
GtkTreeView seems to use a different algorithm for determining whether the mouse is over an expander [cf. gtktreeview.c:do_prelight() and gtktreeview.c:coords_are_over_arrow()]. Maybe we should replicate it?
Marking as fixed. GtkTreeView's expander size calculation has been replicated when committing the fix for bug 448562: http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14095 http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14096
*** Bug 532478 has been marked as a duplicate of this bug. ***