GNOME Bugzilla – Bug 391461
FileChooserDialog sorting order on OSX
Last modified: 2015-03-09 03:11: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:
This is almost certainly a GTK+ issue rather than a gtkmm issue. Reassigning.
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.
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
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?
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.
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.
Created attachment 214153 [details] Folder order
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.
*** Bug 701641 has been marked as a duplicate of this bug. ***
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.
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
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
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 ***