mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-17 01:19:29 +08:00
[darwin] Ensure menu updates occur on main thread
This commit is contained in:
parent
d5a8f1e323
commit
a5e2e42a55
@ -89,6 +89,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Fixed hidden menu items on macOS by [@leaanthony](https://github.com/leaanthony)
|
- Fixed hidden menu items on macOS by [@leaanthony](https://github.com/leaanthony)
|
||||||
- Fixed handling and formatting of errors in message processors by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
|
- Fixed handling and formatting of errors in message processors by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
|
||||||
- Fixed skipped service shutdown when quitting application by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
|
- Fixed skipped service shutdown when quitting application by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
|
||||||
|
- Ensure menu updates occur on the main thread by [@leaanthony](https://github.com/leaanthony)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -72,12 +72,14 @@ func newMenuImpl(menu *Menu) *macosMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *macosMenu) update() {
|
func (m *macosMenu) update() {
|
||||||
|
InvokeSync(func() {
|
||||||
if m.nsMenu == nil {
|
if m.nsMenu == nil {
|
||||||
m.nsMenu = C.createNSMenu(C.CString(m.menu.label))
|
m.nsMenu = C.createNSMenu(C.CString(m.menu.label))
|
||||||
} else {
|
} else {
|
||||||
C.clearMenu(m.nsMenu)
|
C.clearMenu(m.nsMenu)
|
||||||
}
|
}
|
||||||
m.processMenu(m.nsMenu, m.menu)
|
m.processMenu(m.nsMenu, m.menu)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *macosMenu) processMenu(parent unsafe.Pointer, menu *Menu) {
|
func (m *macosMenu) processMenu(parent unsafe.Pointer, menu *Menu) {
|
||||||
|
Loading…
Reference in New Issue
Block a user