Skip to content

Commit

Permalink
[v3] app quit on message (#3990)
Browse files Browse the repository at this point in the history
* app quit on message

* update changelog
  • Loading branch information
mmalcek authored Jan 11, 2025
1 parent c6f9ebe commit 20e050b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/src/content/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix event handling by [@leaanthony](https://github.com/leaanthony)
- Fixed window shutdown logic by [@leaanthony](https://github.com/leaanthony)
- Common taskfile now defaults to generating Typescript bindings for Typescript templates by [@leaanthony](https://github.com/leaanthony)
- Fix Close application on WM_CLOSE message when no windows are open/systray only by [@mmalcek](https://github.com/mmalcek) in [#3990](https://github.com/wailsapp/wails/pull/3990)
- Fixed garble build by @5aaee9 in [#3192](https://github.com/wailsapp/wails/pull/3192)


### Changed

- Moved build assets to platform specific directories by [@leaanthony](https://github.com/leaanthony)
Expand Down
5 changes: 5 additions & 0 deletions v3/pkg/application/application_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,13 @@ func (m *windowsApp) wndProc(hwnd w32.HWND, msg uint32, wParam, lParam uintptr)
}
}

// Handle the main thread window
// Quit the application if requested
// Reprocess and cache screens when display settings change
if hwnd == m.mainThreadWindowHWND {
if msg == w32.WM_ENDSESSION || msg == w32.WM_DESTROY || msg == w32.WM_CLOSE {
globalApplication.Quit()
}
if msg == w32.WM_DISPLAYCHANGE || (msg == w32.WM_SETTINGCHANGE && wParam == w32.SPI_SETWORKAREA) {
err := m.processAndCacheScreens()
if err != nil {
Expand Down

0 comments on commit 20e050b

Please sign in to comment.