Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Scope to Linux, and also handle the app indicator icon path

Manav Rathid2a148736055
diff --git a/mobile/apps/auth/lib/app/view/app.dart b/mobile/apps/auth/lib/app/view/app.dart
index 8468231935..84a038a64d 100644
--- a/mobile/apps/auth/lib/app/view/app.dart
+++ b/mobile/apps/auth/lib/app/view/app.dart
@@ -224,13 +224,7 @@ class _AppState extends State<App>
windowManager.setSkipTaskbar(false);
break;
case 'exit_app':
- if (Platform.isWindows) {
- final int hProcess = GetCurrentProcess();
- TerminateProcess(hProcess, 0);
- } else {
- windowManager.setPreventClose(false);
- windowManager.destroy();
- }
+ _quitApp().ignore();
break;
}
}
@@ -243,13 +237,24 @@ class _AppState extends State<App>
windowManager.hide();
windowManager.setSkipTaskbar(true);
} else {
- if (Platform.isWindows) {
- final int hProcess = GetCurrentProcess();
- TerminateProcess(hProcess, 0);
- } else {
- windowManager.setPreventClose(false);
- windowManager.destroy().then((_) => exit(0));
- }
+ _quitApp().ignore();
+ }
+ }
+
+ Future<void> _quitApp() async {
+ if (Platform.isWindows) {
+ final int hProcess = GetCurrentProcess();
+ TerminateProcess(hProcess, 0);
+ return;
+ }
+
+ await windowManager.setPreventClose(false);
+ await windowManager.destroy();
+
+ // On Linux, closing via window_manager.destroy() can still segfault during
+ // native window teardown. Explicitly exiting here avoids that crash.
+ if (Platform.isLinux) {
+ exit(0);
}
}