5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-21 11:29:29 +08:00

Ensure windowDidBecomeKey callback is running on main thread

This commit is contained in:
Lea Anthony 2024-12-07 20:45:08 +11:00
parent e0d788bea9
commit 5445aebe94
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
2 changed files with 17 additions and 3 deletions

View File

@ -17,8 +17,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Fixed
- [darwin] Ensure `windowDidBecomeKey` callback is running on main thread by [@leaanthony](https://github.com/leaanthony)
## v3.0.0-alpha.8.3 - 2024-12-07 ## v3.0.0-alpha.8.3 - 2024-12-07
### Changed
- Ensure for of taskfile is used by @leaanthony
## v3.0.0-alpha.8.2 - 2024-12-07 ## v3.0.0-alpha.8.2 - 2024-12-07
### Changed ### Changed

View File

@ -1278,9 +1278,14 @@ func (w *macosWebviewWindow) run() {
// We have to wait until the window is shown before we can remove the shadow // We have to wait until the window is shown before we can remove the shadow
var cancel func() var cancel func()
cancel = w.parent.OnWindowEvent(events.Mac.WindowDidBecomeKey, func(_ *WindowEvent) { cancel = w.parent.OnWindowEvent(events.Mac.WindowDidBecomeKey, func(_ *WindowEvent) {
w.setHasShadow(!options.Mac.DisableShadow) InvokeAsync(func() {
w.setAlwaysOnTop(options.AlwaysOnTop) if !w.isVisible() {
cancel() w.parent.Show()
}
w.setHasShadow(!options.Mac.DisableShadow)
w.setAlwaysOnTop(options.AlwaysOnTop)
cancel()
})
}) })
} }
}) })