aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/GpgCoreInit.cpp5
-rw-r--r--src/core/utils/GpgUtils.cpp5
-rw-r--r--src/ui/main_window/MainWindow.cpp2
3 files changed, 9 insertions, 3 deletions
diff --git a/src/core/GpgCoreInit.cpp b/src/core/GpgCoreInit.cpp
index b13a96a0..28635e52 100644
--- a/src/core/GpgCoreInit.cpp
+++ b/src/core/GpgCoreInit.cpp
@@ -497,9 +497,10 @@ auto InitGpgFrontendCore(CoreInitArgs args) -> int {
auto auto_import_missing_key =
settings.value("network/auto_import_missing_key", false).toBool();
+ // force to use pinentry in flatpak container
auto use_pinentry_as_password_input_dialog =
- settings
- .value("gnupg/use_pinentry_as_password_input_dialog", !IsFlatpakENV())
+ IsFlatpakENV() ||
+ settings.value("gnupg/use_pinentry_as_password_input_dialog", true)
.toBool();
// unit test mode
diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp
index c51b7e37..7098e47a 100644
--- a/src/core/utils/GpgUtils.cpp
+++ b/src/core/utils/GpgUtils.cpp
@@ -468,6 +468,11 @@ auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString {
QStringList preferred_list = {"pinentry-qt"};
#endif
+ if (IsFlatpakENV()) {
+ LOG_D() << "set flatpak pinentry to /app/bin/pinentry-qt";
+ return "/app/bin/pinentry-qt";
+ }
+
for (const QString& name : preferred_list) {
QString path = QStandardPaths::findExecutable(name);
if (!path.isEmpty()) {
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp
index 8c8fd55e..e2c4f1e3 100644
--- a/src/ui/main_window/MainWindow.cpp
+++ b/src/ui/main_window/MainWindow.cpp
@@ -120,7 +120,7 @@ void MainWindow::Init() noexcept {
#if !(defined(_WIN32) || defined(WIN32))
connect(this, &MainWindow::SignalLoaded, this, [=]() {
QTimer::singleShot(3000, [self = QPointer<MainWindow>(this)]() {
- if (self != nullptr && DecidePinentry().isEmpty() && !IsFlatpakENV()) {
+ if (self != nullptr && DecidePinentry().isEmpty()) {
QMessageBox::warning(
self, tr("GUI Pinentry Not Found"),
tr("No suitable *graphical* Pinentry program was found on your "