summaryrefslogtreecommitdiffstats
path: root/gtk/src/callbacks.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-07-24 17:33:26 +0000
committerjstebbins <[email protected]>2011-07-24 17:33:26 +0000
commit0fd26df0eea7e63e51c60be40495435947580e5b (patch)
tree6fec5e5d22f270f9ab46beb2226c1a3b24cd740e /gtk/src/callbacks.c
parentc4562d3a2a18c932e67de3d79c44b8fab242f332 (diff)
lingui: work around stupid GtkFileChooser bug
If hidden files are being displayed AND there is no filter attached to the file chooser, the chooser will never highlight the file that get set using gtk_file_chooser_set_filename git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4136 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/callbacks.c')
-rw-r--r--gtk/src/callbacks.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index bcf5c26fc..0fd92a9e6 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -971,6 +971,15 @@ do_source_dialog(GtkButton *button, gboolean single, signal_user_data_t *ud)
gtk_widget_hide(widget);
dialog = GHB_WIDGET(ud->builder, "source_dialog");
source_dialog_extra_widgets(ud, dialog);
+
+ // Gtk has a really stupid bug. If the file chooser is showing
+ // hidden files AND there is no filter set, it will not select
+ // the filename when gtk_file_chooser_set_filename is called.
+ // So add a completely unnessary filter to prevent this behavior.
+ GtkFileFilter *filter;
+ filter = gtk_file_filter_new();
+ gtk_file_filter_add_pattern(filter, "*");
+ gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), sourcename);
response = gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_hide(dialog);