5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-06 06:30:14 +08:00
wails/v3/pkg/application/mainthread_linux.go
Lea Anthony 84e1bb4d9b Improve Linux application events and refactor app method receivers
This commit includes the addition of common events for the Linux platform. Refactored and standardized the method receivers for the application from 'm' to 'l'. Also, the application startup events in the window example have been updated according to the new naming scheme.
2024-03-06 11:48:26 -06:00

19 lines
421 B
Go

//go:build linux
package application
func (l *linuxApp) dispatchOnMainThread(id uint) {
dispatchOnMainThread(id)
}
func executeOnMainThread(callbackID uint) {
mainThreadFunctionStoreLock.RLock()
fn := mainThreadFunctionStore[callbackID]
if fn == nil {
Fatal("dispatchCallback called with invalid id: %v", callbackID)
}
delete(mainThreadFunctionStore, callbackID)
mainThreadFunctionStoreLock.RUnlock()
fn()
}