Cancellable window close request (and app quit request) event
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- cpp
- Domain
- desktop, operating-systems
Research direction
Start by tracing the platform close paths named in the issue: WM_QUERYENDSESSION/WM_ENDSESSION, WM_CLOSE, macOS Cmd+Q, GTK delete-event, and Window::Close(). Review the linked window_manager reports, especially the AppLifecycleListener.onExitRequested compatibility concern. Done means defining and implementing a cross-platform cancellable window-close event and application-level quit request without swallowing system shutdown or breaking Flutter lifecycle handling.
Written by the indexing model from the issue text.
Description
There's no way to intercept a window being closed. Only WindowClosedEvent fires after the fact. window_manager 0.6.0 currently can't implement setPreventClose / onWindowClose for the system close button, and documents that as a gap.
Proposal: a cancellable close-request event per window, raised by the close button, Alt+F4, the taskbar/Dock menu and delete-event, plus Window::Close(). Requirements from the reports below:
- system shutdown, logoff and installer-initiated closes (
WM_QUERYENDSESSION/WM_ENDSESSION, or aWM_CLOSEfrom another process) must not be silently swallowed - Cmd+Q / app termination on macOS should surface as an application-level quit request (cancellable), distinct from window close
- it must not break Flutter's own
AppLifecycleListener.onExitRequestedwhen nobody listens - possibly the same pattern for minimize/maximize requests
Background:
- leanflutter/window_manager#356: setPreventClose blocks the MSI installer from closing the app
- leanflutter/window_manager#362: Cmd+Q doesn't trigger onWindowClose on macOS
- leanflutter/window_manager#466: window_manager breaks AppLifecycleListener.onExitRequested
- leanflutter/window_manager#316: need setPreventMinimize / setPreventMaximize
- Dominant language
- C++
- Stars
- 34
- Forks
- 7
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libnativeapi/nativeapi
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
libnativeapi/nativeapi#81 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
libnativeapi/nativeapi#80 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
libnativeapi/nativeapi#79 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
libnativeapi/nativeapi#78 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
libnativeapi/nativeapi#77 ·
All issues in libnativeapi/nativeapi
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantStack/git2cpp#187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100