-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopc: regressionIt was better in the past than it is nowIt was better in the past than it is nowcustomer: googleVarious Google teamsVarious Google teamsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specifically
Description
In an application that wants to handle WM_CLOSE in a special way (like continuing to run in the background), the event handling that the WindowsLifecycleManager does isn't optimal: it prevents the custom WM_CLOSE handler from running, since it always handles the event, preventing the event from propagating.
Perhaps the event should never be handled by the WindowsLifecycleManager, and if the app allows the exit request, then it will exit, closing the window anyhow, and aborting the window close itself should be handled by the (as yet nonexistent) windowing API.
If that's not the solution, then perhaps this is what we need to do:
- Windows sends WM_CLOSE message
- Flutter eats the Windows message and notifies the framework
- If the framework cancels the exit, Flutter creates a new WM_CLOSE message
- This new WM_CLOSE message is ignored by Flutter, allowing the app to use custom logic
In any case, we need to evaluate how to enable this scenario.
Related internal issue: b/275565297
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopc: regressionIt was better in the past than it is nowIt was better in the past than it is nowcustomer: googleVarious Google teamsVarious Google teamsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specifically