Summary
On Windows, once pdfrxFlutterInitialize() has run, closing the window with the title-bar X no
longer triggers AppLifecycleListener.onExitRequested, so apps can't run graceful shutdown. It
happens from init alone, before any PDF is rendered, and reproduces on the latest versions.
Environment
pdfrx 2.4.7, pdfrx_engine 0.4.6, Flutter 3.44.7 (stable), Windows 10.
Repro
- Windows desktop app that registers:
AppLifecycleListener(onExitRequested: () async {
debugPrint('FIRED');
return AppExitResponse.exit;
});
- Close with the X → prints
FIRED.
- Add
await pdfrxFlutterInitialize(); in main(), run again, close with the X.
Expected: still prints FIRED. Actual: never prints; the app just exits.
Note
After pdfrxFlutterInitialize(), the process owns an extra hidden top-level window
(GDI+ Hook Window Class); removing the init call removes the window and restores
onExitRequested. This appears to defeat the Windows engine's last-window exit check.
Summary
On Windows, once
pdfrxFlutterInitialize()has run, closing the window with the title-bar X nolonger triggers
AppLifecycleListener.onExitRequested, so apps can't run graceful shutdown. Ithappens from init alone, before any PDF is rendered, and reproduces on the latest versions.
Environment
pdfrx 2.4.7, pdfrx_engine 0.4.6, Flutter 3.44.7 (stable), Windows 10.
Repro
FIRED.await pdfrxFlutterInitialize();inmain(), run again, close with the X.Expected: still prints
FIRED. Actual: never prints; the app just exits.Note
After
pdfrxFlutterInitialize(), the process owns an extra hidden top-level window(
GDI+ Hook Window Class); removing the init call removes the window and restoresonExitRequested. This appears to defeat the Windows engine's last-window exit check.