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 689451 - gtk 3.6 filechooser has a regression in folder mode, doesn't let to open/enter folders
gtk 3.6 filechooser has a regression in folder mode, doesn't let to open/ente...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
filechooser-design-needed
Depends on:
Blocks:
 
 
Reported: 2012-12-01 19:26 UTC by Alexey Yakovenko
Modified: 2018-04-15 00:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
folders are insensitive (155.19 KB, image/png)
2012-12-01 19:26 UTC, Alexey Yakovenko
Details

Description Alexey Yakovenko 2012-12-01 19:26:03 UTC
Created attachment 230402 [details]
folders are insensitive

example code below, screenshot demonstrating the problem attached.

if non-default file filter function is used -- folders are insensitive.
if "all files" is selected -- works correctly.

this code works fine in GTK2 and GTK3.4, but not in 3.6.
was tested in ubuntu and mint.

    GtkWidget *dlg = gtk_file_chooser_dialog_new (_("Add folder(s) to playlist..."), GTK_WINDOW (mainwin), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL);

    GtkFileFilter* flt;
    flt = gtk_file_filter_new ();
    gtk_file_filter_set_name (flt, name);

    gtk_file_filter_add_custom (flt, GTK_FILE_FILTER_FILENAME, file_filter_func, NULL, NULL);
    gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dlg), flt);
    gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dlg), flt);
    flt = gtk_file_filter_new ();
    gtk_file_filter_set_name (flt, _("All files (*)"));
    gtk_file_filter_add_pattern (flt, "*");
    gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dlg), flt);

    gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dlg), TRUE);
    gtk_widget_destroy (dlg);
Comment 1 Federico Mena Quintero 2012-12-31 20:09:32 UTC
Indeed, this behavior changed due to bug #679333.  The idea was to let custom filters work for folders as well, in GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, just like filters work for normal files in the "select a file" modes.

One option is to restore the old behavior, and only enable the new one if you call a function (which we would have to add) like gtk_file_chooser_set_filters_act_on_folders() or something.

Jon, what do you think?
Comment 2 Matthias Clasen 2018-02-10 05:25:50 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 3 Matthias Clasen 2018-04-15 00:35:35 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new