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 148828 - Side Pane in File Selector requires double-click
Side Pane in File Selector requires double-click
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
unspecified
Other Linux
: Normal normal
: Small fix
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2004-07-30 02:12 UTC by Brian
Modified: 2007-12-13 14:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for gtk 2.10.7 (2.06 KB, patch)
2007-01-09 23:12 UTC, Josselin Mouette
reviewed Details | Review
Updated patch to monitor selection changes (2.54 KB, patch)
2007-01-10 21:28 UTC, Josselin Mouette
needs-work Details | Review
single-click patch, round 3 (1.98 KB, patch)
2007-02-18 03:51 UTC, Josselin Mouette
none Details | Review
Single-click patch, round 4 (2.18 KB, patch)
2007-04-11 23:24 UTC, Josselin Mouette
none Details | Review
Updated for 2.11.2 (3.38 KB, patch)
2007-06-14 01:05 UTC, Josselin Mouette
none Details | Review
Updated patch for GTK+ 2.12.1 (5.34 KB, patch)
2007-11-04 15:03 UTC, Josselin Mouette
accepted-commit_now Details | Review

Description Brian 2004-07-30 02:12:50 UTC
The side pane (which displays "Home", "Desktop", etc) in the file selector
requires a double-click to navigate to an object. Yet, the widget clearly looks
and behaves like a listbox. In other places (e.g. preference panels), selections
take effect immediately with a single click. Also, the sidepane changes the
selected item to match the location selected (e.g. if you browse from home to
bin,  home becomes unselected). This also mirrors the behavior of a listbox.
Moreover, similar side-pane select objects (in Windows, Mac OS X, and KDE) are
single-click.
Comment 1 Mantas Kriaučiūnas 2006-11-23 12:30:55 UTC
Side Pane in File Selector still requires double-click :( It's hard to fix or GTK developers simply don't think, that single click behavior (like in Windows, Mac OS X, and KDE) is better here ? 
Comment 2 Egmont Koblinger 2006-11-23 13:25:00 UTC
Patch for Gtk+ 2.8.19:
https://svn.uhulinux.hu/packages/2.0/gtk2/patches/05-filechooser-click.patch
and for Nautilus 2.14.1:
https://svn.uhulinux.hu/packages/2.0/nautilus2/patches/09-click.patch

These are absolutely unofficial patches, created by my colleague for the UHU-Linux 2.0 distro. Use at your own risk :)
Comment 3 Josselin Mouette 2007-01-02 14:44:07 UTC
See also http://bugs.debian.org/405296
Comment 4 Josselin Mouette 2007-01-09 23:12:19 UTC
Created attachment 79901 [details] [review]
patch for gtk 2.10.7

This is the same patch, updated for GTK+ 2.10.7, that I've applied to the Debian gtk packages. No problem so far, and it really makes the UI more consistent.
Comment 5 Federico Mena Quintero 2007-01-10 01:24:42 UTC
Comment on attachment 79901 [details] [review]
patch for gtk 2.10.7

Thanks for the patch!

Don't you want to monitor "changed" on the selection instead of monitoring the cursor?

How does this deal with drag-and-drop of items in the shortcuts pane to reorder them?
Comment 6 Josselin Mouette 2007-01-10 19:05:06 UTC
> Don't you want to monitor "changed" on the selection instead of monitoring
> the cursor?

That would indeed be more consistent.

> How does this deal with drag-and-drop of items in the shortcuts pane to 
> reorder them?

It doesn't affect them. Well, the item is dropped at a wrong place, but this is clearly another issue, it is here even without the patch.
Comment 7 Josselin Mouette 2007-01-10 21:28:04 UTC
Created attachment 79989 [details] [review]
Updated patch to monitor selection changes

Here is the patch doing things the correct way by monitoring selection changes.

(Forget about that "wrong place" thing, my .gtk-bookmarks was corrupted.)
Comment 8 Federico Mena Quintero 2007-01-23 17:43:15 UTC
Comment on attachment 79989 [details] [review]
Updated patch to monitor selection changes

This is working better.  I made a little change: don't focus the file list in shortcuts_selection_changed_cb(), because that breaks keyboard navigation in the shortcuts pane (you'd select an item with the arrow keys, and the shortcuts pane would immediately lose the focus).

Some remaining problems:

1. When you use something other than the shortcuts pane to switch to a folder (say, by clicking on the path bar or by double-clicking on a folder in the file list), the shortcuts pane will highlight one of its items if that item is the new folder.  So, we change to the same folder *twice*.

2. With the removal of the call to focus the file list, you switch folders from the shortcuts pane but the first file in the file list still gets selected.  This needs to happen only when switching folders from the file list itself.

3. In GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, this doesn't work to select a folder and confirm the dialog: click on a folder in the shortcuts pane; click the Open button.

4. Drag and drop to reorder the shortcuts is broken.  The list scrolls to the top every time you drag something, and items don't get dropped in the right place.  This may not be actually a problem with the patch (why did this break!?!?).

I like the new behavior a lot, except for these problems.  If you could take the time to fix them, I'll owe you a beer or your beverage of choice :)
Comment 9 Josselin Mouette 2007-02-18 03:51:27 UTC
Created attachment 82777 [details] [review]
single-click patch, round 3

Here is an updated patch that fixes points 1 and 3.

Point 2 is trickier, because change_folder_and_display_error is setting the selection unconditonally after changing the folder. I have tried to force the selection using the "current-folder-changed" signal, but it doesn't help.

Point 4 is similar to a problem I also encountered while playing with this patch. It was caused by the .gtk-bookmarks file being corrupt.
Comment 10 Josselin Mouette 2007-04-11 23:24:07 UTC
Created attachment 86208 [details] [review]
Single-click patch, round 4

This latest version removes a regression introduced, that forces the user to click twice on "save" sometimes. I'm not aware of any other regressions now, and have the feeling it is really mature enough.
Comment 11 Loïc Minier 2007-06-13 09:51:20 UTC
Doesn't apply against 2.11.3; you might want to rebase against trunk.
Comment 12 Josselin Mouette 2007-06-14 01:05:43 UTC
Created attachment 89922 [details] [review]
Updated for 2.11.2

This version works with 2.11.2 and applies cleanly on trunk.
Comment 13 Josselin Mouette 2007-11-04 15:03:13 UTC
Created attachment 98516 [details] [review]
Updated patch for GTK+ 2.12.1

This is the patch updated to apply cleanly to GTK+ 2.12.1.

It contains fixes for the following additional bugs caused by the previous version:
 * http://bugs.debian.org/448674 : keyboard navigation selects the first shortcut when the shortcuts pane is focused; requires the patch in bug#492206 to be useful.
 * http://bugs.debian.org/447279 : assertion error when reordering a bookmark which is a duplicate of another shortcut; the single-click patch caused the selection to change during DnD, and this is avoided by correctly filtering out duplicates.
Comment 14 Martin Ejdestig 2007-11-21 18:51:16 UTC
Is this a good idea? Yes, fewer clicks when changing places. But why is the folder list so different? Also, it would be good to have the same behaviour in the file chooser as in nautilus.
Comment 15 Martin Ejdestig 2007-11-21 20:02:14 UTC
Ok, so now you add places by selecting a folder and pressing Add. If Add is changed to add the current folder instead, you can have single click in the folder list also.

Wouldn't the Add and Remove operations be more similar in this way? When you single click in Places, you are brought to the folder you just clicked on so when you later press remove, you remove the folder you are currently visiting. To add, you visit the folder you want to add and press Add.

I don't know. I just don't like the way single and double clicks are mixed. How is the user supposed to know when to use which. (Though this is a wider problem covering the whole desktop.)
Comment 16 Josselin Mouette 2007-11-22 10:47:09 UTC
See bug#355760 for the similar change in nautilus.

As for adding the current folder instead of the selected one, I'd find it more intuitive indeed. I was bitten several times by it, regardless of the single/double click. But I don't know if it's on purpose for this patch.
Comment 17 Martin Ejdestig 2007-11-22 15:21:31 UTC
I'll open a new bug if this one is closed without Federico commenting on it. :)
Comment 18 Federico Mena Quintero 2007-11-26 18:18:36 UTC
(In reply to comment #13)

> This is the patch updated to apply cleanly to GTK+ 2.12.1.

Very nice.  Thanks, Josselin!

Could you please commit this with a suitable ChangeLog to SVN trunk?  [If you don't have an SVN account, just give me a ChangeLog entry and I'll commit it for you.]

Let's take care of the remaining problems in different bugs:

- Selecting a shortcut shouldn't take the focus to the file list.  This makes keyboard navigation impossible in the shortcuts pane.

- DnD reorders things in the wrong place.  I think this is already filed somewhere.
Comment 19 Josselin Mouette 2007-11-26 23:24:06 UTC
Committed (r19072).

As for the DnD issue, it is caused when .gtk-bookmarks contains nonexistent directories (or, in the case of these modifications, directories that are also mounts).
Comment 20 Federico Mena Quintero 2007-11-27 01:50:58 UTC
Thanks for committing, Joss.  I'll mark the bug as fixed.

Good catch on the DnD bug... can you please open another bug to mention that  reordering is broken when there are non-existent directories in .gtk-bookmarks?
Comment 21 Josselin Mouette 2007-11-27 10:44:29 UTC
See bug#499940 for the focus issue and bug#499929 for the bookmarks issue.
Comment 22 Sebastien Bacher 2007-12-13 14:33:18 UTC
the patch creates the focus issue from bug #468445