Skip to content

Commit d8af50b

Browse files
committed
FileChooser (Linux): Better sanitize file extension patterns for Zenity
With Zenity 4.2.2, I was seeing that file extension patterns with a trailing space (example below) were causing the file chooser process to start, but the window never became visible. zenity --file-selection --file-filter="*.a *.b "
1 parent 96224db commit d8af50b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

modules/juce_gui_basics/native/juce_FileChooser_linux.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class FileChooser::Native final : public FileChooser::Pimpl,
208208
}
209209

210210
args.add (startPath.getFullPathName());
211-
args.add ("(" + owner.filters.replaceCharacter (';', ' ') + ")");
211+
args.add ("(" + owner.filters.replaceCharacter (';', ' ').trim() + ")");
212212
}
213213

214214
void addZenityArgs()
@@ -266,6 +266,7 @@ class FileChooser::Native final : public FileChooser::Pimpl,
266266
{
267267
StringArray tokens;
268268
tokens.addTokens (owner.filters, ";,|", "\"");
269+
tokens.removeEmptyStrings();
269270

270271
args.add ("--file-filter=" + tokens.joinIntoString (" "));
271272
}

0 commit comments

Comments
 (0)