diff --git a/client/main.cpp b/client/main.cpp index c42144f1c..9a9ee8b86 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -26,6 +26,22 @@ int main( int argc, char *argv[] ) { +#ifdef Q_OS_LINUX + // On GNOME Qt picks the GTK3 platform theme, whose file chooser hard-codes + // gtk_file_chooser_set_local_only(true). That hides every location without a + // native path, so gvfs network mounts (NAS over SFTP/SMB, added in Files) are + // missing from the save dialog even though they are mounted and writable. + // The xdg-desktop-portal chooser is GTK4, which dropped local_only entirely, + // so it lists them. Qt never selects that theme on its own, hence the override. + // + // Requires qt6-xdgdesktopportal-platformtheme (a Recommends of this package). + // If it is missing Qt falls through to gtk3, i.e. the previous behaviour, so + // tell users who cannot see a network location in the save dialog to install + // that package. Setting QT_QPA_PLATFORMTHEME yourself overrides this. + if(qEnvironmentVariableIsEmpty("QT_QPA_PLATFORMTHEME")) + qputenv("QT_QPA_PLATFORMTHEME", "xdgdesktopportal"); +#endif + for(int i = 1; i < argc; ++i) { QString parameter(argv[i]); diff --git a/debian/control b/debian/control index df7cf7a56..a64581ca5 100644 --- a/debian/control +++ b/debian/control @@ -27,6 +27,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: + qt6-xdgdesktopportal-platformtheme, python3-nautilus:amd64 | python3-nautilus:arm64 Replaces: qdigidoc (<< 3.14)