fix: Windows file save dialog appearing behind app window (#3214)
What changed, and why it matters
This commit fixes two minor Windows app issues: it makes the file save dialog appear in front of the app window instead of hiding behind it, and it prevents the app from crashing when a user cancels the save dialog. It is a routine bug-fix patch, not a security fix for an exploitable vulnerability.
No security action required; treat as a normal quality/UX fix.
Security signals we found
No security-relevant signal: UI z-order fix for Windows file dialog
No security-relevant signal: null-safety/crash-prevention for canceled save dialog
No changes to authentication, cryptography, network, storage permissions, or input validation
Evidence from the diff
The change adds lockParentWindow: true to four FilePicker.platform.saveFile() calls in Dart/Flutter code so the Win32 save dialog receives the Flutter window as its owner window. It also replaces force-unwrapped nullable results (outputFile!) with null checks (if (outputFile == null) return;) so cancellation no longer throws an unhandled exception. No security boundary is crossed and no sensitive data handling is altered.
Changed components
lib/src/screens/backup/backup_page.dartlib/src/screens/seed/wallet_seed_page.dartlib/src/screens/settings/mweb_logs_page.dartlib/src/screens/settings/silent_payments_logs_page.dartInspect captured patch +22 / −6
diff --git a/lib/src/screens/backup/backup_page.dart b/lib/src/screens/backup/backup_page.dart
index cab867b..59abff9 100644
--- a/lib/src/screens/backup/backup_page.dart
+++ b/lib/src/screens/backup/backup_page.dart
@@ -172,10 +172,15 @@ class BackupPage extends BasePage {
Future<void> _saveFile(BackupExportFile backup) async {
String? outputFile = await FilePicker.platform
- .saveFile(dialogTitle: 'Save Your File to desired location', fileName: backup.name);
+ .saveFile(
+ dialogTitle: 'Save Your File to desired location',
+ fileName: backup.name,
+ lockParentWindow: true);
+
+ if (outputFile == null) return;
try {
- await backup.file.copy(outputFile!);
+ await backup.file.copy(outputFile);
} catch (exception, stackTrace) {
await ExceptionHandler.onError(FlutterErrorDetails(
exception: exception,
diff --git a/lib/src/screens/seed/wallet_seed_page.dart b/lib/src/screens/seed/wallet_seed_page.dart
index f0794f9..97da1e0 100644
--- a/lib/src/screens/seed/wallet_seed_page.dart
+++ b/lib/src/screens/seed/wallet_seed_page.dart
@@ -158,6 +158,7 @@ class WalletSeedPage extends BasePage {
final path = await FilePicker.platform.saveFile(
dialogTitle: "Save seed as",
fileName: "${walletSeedViewModel.name}-seed.txt",
+ lockParentWindow: true,
);
if(path != null) {
final file = File(path);
diff --git a/lib/src/screens/settings/mweb_logs_page.dart b/lib/src/screens/settings/mweb_logs_page.dart
index 8310673..6fd6ead 100644
--- a/lib/src/screens/settings/mweb_logs_page.dart
+++ b/lib/src/screens/settings/mweb_logs_page.dart
@@ -104,12 +104,17 @@ class MwebLogsPage extends BasePage {
Future<void> _saveFile() async {
String? outputFile = await FilePicker.platform
- .saveFile(dialogTitle: 'Save Your File to desired location', fileName: "debug.log");
+ .saveFile(
+ dialogTitle: 'Save Your File to desired location',
+ fileName: "debug.log",
+ lockParentWindow: true);
+
+ if (outputFile == null) return;
try {
final filePath = (await getApplicationSupportDirectory()).path + "/debug.log";
File debugLogFile = File(filePath);
- await debugLogFile.copy(outputFile!);
+ await debugLogFile.copy(outputFile);
} catch (exception, stackTrace) {
ExceptionHandler.onError(FlutterErrorDetails(
exception: exception,
diff --git a/lib/src/screens/settings/silent_payments_logs_page.dart b/lib/src/screens/settings/silent_payments_logs_page.dart
index baea684..102755f 100644
--- a/lib/src/screens/settings/silent_payments_logs_page.dart
+++ b/lib/src/screens/settings/silent_payments_logs_page.dart
@@ -106,12 +106,17 @@ class SilentPaymentsLogPage extends BasePage {
Future<void> _saveFile() async {
String? outputFile = await FilePicker.platform
- .saveFile(dialogTitle: 'Save Your File to desired location', fileName: "debug.log");
+ .saveFile(
+ dialogTitle: 'Save Your File to desired location',
+ fileName: "debug.log",
+ lockParentWindow: true);
+
+ if (outputFile == null) return;
try {
final filePath = (await getApplicationSupportDirectory()).path + "/debug.log";
File debugLogFile = File(filePath);
- await debugLogFile.copy(outputFile!);
+ await debugLogFile.copy(outputFile);
} catch (exception, stackTrace) {
ExceptionHandler.onError(FlutterErrorDetails(
exception: exception,
Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.