diff --git a/lib/main.dart b/lib/main.dart index e9cd53b7..168af9cb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -57,8 +57,6 @@ void _absorbZeroOffsetPointerEvent(PointerEvent event) { } } -final ValueNotifier appClosing = ValueNotifier(false); - void main() async { WidgetsFlutterBinding.ensureInitialized(); _installZeroOffsetPointerGuard(); // Workaround for iPadOS 26.1+ modal dismissal bug @@ -257,17 +255,6 @@ class _MainAppState extends State with WidgetsBindingObserver { darkTheme: themeProvider.darkTheme, themeMode: themeProvider.materialThemeMode, navigatorObservers: [routeObserver], - builder: (context, child) { - return ValueListenableBuilder( - valueListenable: appClosing, - builder: (context, closing, _) { - if (!closing) { - return child ?? const SizedBox.shrink(); - } - return const SizedBox.expand(child: ColoredBox(color: Colors.black)); - }, - ); - }, home: const OrientationAwareSetup(), ), ), diff --git a/lib/screens/main_screen.dart b/lib/screens/main_screen.dart index 19735958..3b830041 100644 --- a/lib/screens/main_screen.dart +++ b/lib/screens/main_screen.dart @@ -1,4 +1,4 @@ -import 'dart:io' show Platform; +import 'dart:io' show Platform, exit; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -68,7 +68,6 @@ class MainScreen extends StatefulWidget { } class _MainScreenState extends State with RouteAware, WindowListener { - bool _isClosing = false; late int _currentIndex; String? _selectedLibraryGlobalKey; @@ -298,16 +297,7 @@ class _MainScreenState extends State with RouteAware, WindowListener @override void onWindowClose() { - if (_isClosing) return; - _isClosing = true; - - appClosing.value = true; - - // Give the UI a brief moment to settle before tearing down the window. - Future.delayed(const Duration(milliseconds: 150), () async { - await windowManager.setPreventClose(false); - await windowManager.destroy(); - }); + exit(0); } List _buildScreens(bool offline) {