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 391461 - FileChooserDialog sorting order on OSX
FileChooserDialog sorting order on OSX
Status: RESOLVED DUPLICATE of bug 673047
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.24.x
Other Mac OS
: Normal minor
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
: 701641 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-01-01 02:27 UTC by Bryce Harrington
Modified: 2015-03-09 03:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Folder order (102.56 KB, image/png)
2012-05-15 20:46 UTC, Clayton Walker
Details

Description Bryce Harrington 2007-01-01 02:27:57 UTC
Please describe the problem:
The FileChooserDialog displays filenames in strict alphabetical order, with uppercase letters sorted before lower case letters, which on Linux is as expected.  However, an OSX Inkscape user reported a bug that this is not as expected on OSX:

http://sourceforge.net/tracker/index.php?func=detail&aid=1609779&group_id=93438&atid=604306

I am not familiar with OSX, but if OSX has the policy of sorting regardless of case, then should Gtk sort that way on OSX, or should it be sorting in the Linux style?

Steps to reproduce:
1. In inkscape on OSX, load the File import dialog


Actual results:
Capitalized files appear above lower case.

Expected results:
On OSX, should sort as appropriate for OSX applications.  On Linux, the current behavior is correct.

Does this happen every time?
Yes

Other information:
Comment 1 Murray Cumming 2007-01-07 16:10:36 UTC
This is almost certainly a GTK+ issue rather than a gtkmm issue. Reassigning.
Comment 2 Matthias Clasen 2007-01-07 20:12:55 UTC
I don't think it is an issue at all, really. There is no obviously "correct" way
to sort the file list. I am not convinced that we want to start making sort order platform-dependent. 
Comment 3 Bryce Harrington 2007-01-08 19:39:35 UTC
The following link discusses on desktop integration of the file selector,
including platform-specific behavior, however it did not touch on the 
file sort order:

http://people.redhat.com/otaylor/fosdem2003/file-selector.html#desktop-integration

Comment 4 Björn Lindqvist 2007-03-12 17:18:29 UTC
On windows GtkFileChooserDialog already sorts in case-insenstive alphabetical order. Im fairly sure it does in Linux too. So, if someone with OSX can reproduce this behaviour, it must be a bug?
Comment 5 Matt Johnston 2008-11-04 01:05:49 UTC
Matthias: The "correct" sort order is kind of defined on osx, to be the same as the Finder. http://developer.apple.com/qa/qa2004/qa1159.html has some notes on that.
Comment 6 Michael Natterer 2012-05-15 20:35:21 UTC
On my mac, the sort order in the GTK+ file chooser is totally random,
I fail to find any pattern in the order. This is GIMP master
on the gtk-2-24 branch.
Comment 7 Clayton Walker 2012-05-15 20:46:29 UTC
Created attachment 214153 [details]
Folder order
Comment 8 Federico Mena Quintero 2012-05-17 17:20:44 UTC
Can someone with a Mac please check this:

1. Set a breakpoint in gtkfilechooserdefault.c:name_sort_func()
2. See what key_a and key_b get set to (they are the strings for collation, not the actual filenames, so they may be weird).

If things seem odd, check what file_system_model_set() is doing in the case for MODEL_COL_NAME_COLLATED.  There, we do

        g_value_take_string (value, g_utf8_collate_key_for_filename (g_file_info_get_display_name (info), -1));

I assume g_file_info_get_display_name() is properly returning things in UTF-8.
Comment 9 Michael Schumacher 2013-06-05 14:12:40 UTC
*** Bug 701641 has been marked as a duplicate of this bug. ***
Comment 10 Michael Natterer 2013-06-05 16:03:44 UTC
Err, didn't I fix this with this commit in GLib?

commit ef8510be09a746dcbc8d470376688820b225c40f
Author: Michael Natterer <mitch@gimp.org>
Date:   Fri Nov 16 18:48:09 2012 +0100

    Bug 673047 - gunicollate is broken on OS X
    
    Apply slightly modified patch from Camillo Lugaresi which fixes
    gunicollate for OSX >= 10.6. It was totally hilariously broken
    for anyone on 10.6 and later, I dont know if it's now broken
    on 10.5, but better fix it for the vast majority of users.
Comment 11 Daniel Macks 2013-06-13 03:58:24 UTC
glib-2.36.2 still fails its collation tests. On 10.8...

FAIL: run-collate-tests.sh
==========================

3a4
> bla4
6d6
< bla4
Test failed: unexpected error when using g_utf8_collate_key_for_filename() on ./collate/collate-2.in
Comment 12 Timothy Arceri 2013-06-13 11:00:52 UTC
Is the original bug report still valid here? Or is it now just a matter of fixing g_utf8_collate_key_for_filename()? If so should this be reassigned to Glib rather than GTK
Comment 13 Michael Natterer 2013-06-13 11:15:15 UTC
It is a duplicate of the gunicollate bug, the sorting in the file
chooser is now correct.

*** This bug has been marked as a duplicate of bug 673047 ***