X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4e621d24713f971d1a2d440f79ccc4593aede4b6..14722c43c30918cd8fbba956b50ac3426d2fe339:/src/gtk/filepicker.cpp?ds=inline diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index 213b1e1a8e..f93d3428f2 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -131,7 +131,15 @@ void wxFileButton::SetPath(const wxString &str) void wxFileButton::SetInitialDirectory(const wxString& dir) { if (m_dialog) - DoSetInitialDirectory(static_cast(m_dialog), dir); + { + // Only change the directory if the default file name doesn't have any + // directory in it, otherwise it takes precedence. + if ( m_path.find_first_of(wxFileName::GetPathSeparators()) == + wxString::npos ) + { + static_cast(m_dialog)->SetDirectory(dir); + } + } else wxGenericFileButton::SetInitialDirectory(dir); }