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 342357 - Unxepected file opening when clicking directory arrow in list mode
Unxepected file opening when clicking directory arrow in list mode
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: List View
2.22.x
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 514975 532478 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-05-19 16:10 UTC by Fredrik Nilsson
Modified: 2008-05-10 13:22 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Adjusted expander size calculation. (850 bytes, patch)
2008-04-15 15:25 UTC, Paweł Paprota
needs-work Details | Review
Second version. (2.10 KB, patch)
2008-04-15 18:31 UTC, Paweł Paprota
reviewed Details | Review

Description Fredrik Nilsson 2006-05-19 16:10:17 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.
Comment 1 Josselin Mouette 2006-11-14 21:19:44 UTC
This bug is still here in nautilus 2.16.
Comment 2 Malte 2006-12-10 17:36:01 UTC
Confirming (though still using nautilus 2.14.1). This is very annoying.
Comment 3 Christoph Wolk 2007-10-10 12:06:02 UTC
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.
Comment 4 Cosimo Cecchi 2008-03-18 14:51:59 UTC
Confirming with 2.22.0.
Comment 5 Cosimo Cecchi 2008-03-18 14:54:03 UTC
*** Bug 514975 has been marked as a duplicate of this bug. ***
Comment 6 Paweł Paprota 2008-04-15 15:25:48 UTC
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
Comment 7 Cosimo Cecchi 2008-04-15 17:17:19 UTC
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.
Comment 8 Paweł Paprota 2008-04-15 18:31:36 UTC
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.
Comment 9 Johannes Mockenhaupt 2008-04-15 20:25:25 UTC
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. 
Comment 10 Paweł Paprota 2008-04-15 20:32:14 UTC
Johannes: thanks for testing!
Comment 11 Cosimo Cecchi 2008-04-15 23:25:49 UTC
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.
Comment 12 Christian Neumair 2008-04-16 18:15:25 UTC
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?
Comment 13 Christian Neumair 2008-04-27 16:07:42 UTC
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
Comment 14 Cosimo Cecchi 2008-05-10 13:22:30 UTC
*** Bug 532478 has been marked as a duplicate of this bug. ***