summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_File_Chooser2.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index c9264d7c4..c55012734 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -533,14 +533,16 @@ Fl_File_Chooser::fileNameCB()
#endif /* WIN32 || __EMX__ */
directory(pathname);
} else if ((type_ & CREATE) || access(pathname, 0) == 0) {
- // Update the preview box...
- update_preview();
+ if (!fl_filename_isdir(pathname) || (type_ & DIRECTORY)) {
+ // Update the preview box...
+ update_preview();
- // Do any callback that is registered...
- if (callback_) (*callback_)(this, data_);
+ // Do any callback that is registered...
+ if (callback_) (*callback_)(this, data_);
- // Hide the window to signal things are done...
- window->hide();
+ // Hide the window to signal things are done...
+ window->hide();
+ }
} else {
// File doesn't exist, so beep at and alert the user...
fl_alert(existing_file_label);