Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Cancellable window close request (and app quit request) event

Open
#65 0 comments 0 reactions 0 assignees View on GitHub

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

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

enhancement

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 a WM_CLOSE from 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.onExitRequested when 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libnativeapi/nativeapi

All issues in libnativeapi/nativeapi

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.