Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ int main(int argc, char** argv)
}

#ifdef Q_OS_LINUX
if (qEnvironmentVariable("MU_QT_QPA_PLATFORM") != "offscreen") {
// NOTE: gtk3 is forced by default because it fixed keyboard input in file dialogs (#13113).
// Respect an explicitly configured theme (e.g. "xdgdesktopportal") instead of overriding it,
// so desktop environments that rely on the portal for native/sandboxed dialogs keep working.
if (qEnvironmentVariable("MU_QT_QPA_PLATFORM") != "offscreen"
&& !qEnvironmentVariableIsSet("QT_QPA_PLATFORMTHEME")) {
qputenv("QT_QPA_PLATFORMTHEME", "gtk3");
}

Expand Down
14 changes: 14 additions & 0 deletions src/project/internal/exportprojectscenario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ RetVal<muse::io::path_t> ExportProjectScenario::askExportPath(const INotationPtr
RetVal<muse::io::path_t> exportPath;
exportPath.val = interactive()->selectSavingFileSync(muse::trc("project/export", "Export"), defaultPath,
exportType.filter(), isCreatingOnlyOneFile);

if (!exportPath.val.empty()) {
// Some Linux file dialogs don't auto-append the extension the user didn't type,
// which would otherwise leave us without a writer for this path in exportScores().
std::string actualSuffix = io::suffix(exportPath.val);
bool hasKnownSuffix = std::find_if(exportType.suffixes.cbegin(), exportType.suffixes.cend(), [&actualSuffix](const QString& s) {
return s.toStdString() == actualSuffix;
}) != exportType.suffixes.cend();

if (!hasKnownSuffix) {
exportPath.val = exportPath.val.appendingSuffix(exportType.suffixes.front().toStdString());
}
}

exportPath.ret = !exportPath.val.empty();

return exportPath;
Expand Down
Loading