Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: execute OnShutdown on WM_ENDSESSION #3894

Open
anfragment opened this issue Nov 20, 2024 · 0 comments
Open

Windows: execute OnShutdown on WM_ENDSESSION #3894

anfragment opened this issue Nov 20, 2024 · 0 comments
Labels
Enhancement New feature or request

Comments

@anfragment
Copy link

Is your feature request related to a problem? Please describe.

On Windows, Wails's primary WndProc doesn't handle WM_ENDSESSION nor WM_QUERYENDSESSION, which results in OnShutdown not executing on system shutdown.
A concrete example of where this is not the desirable behavior is a system proxy application. During shutdown, such an application might disable traffic proxying which it set up during runtime. If proxying is not turned off during system shutdown, after being turned back on the system will experience network connectivity issues until the application is reenabled or the user disables proxying manually.

Describe the solution you'd like

Wails executes OnShutdown after receiving WM_ENDESSION. Optionally, it might also listen for WM_QUERYENDSESSION and prevent shutdown by returning false if OnBeforeClose returns true.

Describe alternatives you've considered

No response

Additional context

No response

@anfragment anfragment added the Enhancement New feature or request label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant