mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
@@ -3,10 +3,13 @@
|
||||
package application
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/events"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -100,12 +103,10 @@ func (m *linuxApp) run() error {
|
||||
|
||||
// Add a hook to the ApplicationDidFinishLaunching event
|
||||
// FIXME: add Wails specific events - i.e. Shouldn't platform specific ones be translated to Wails events?
|
||||
//m.parent.On(events.Mac.ApplicationDidFinishLaunching, func(evt *Event) {
|
||||
// // Do we need to do anything now?
|
||||
// fmt.Println("events.Mac.ApplicationDidFinishLaunching received!")
|
||||
//})
|
||||
|
||||
m.setupCommonEvents()
|
||||
m.parent.On(events.Mac.ApplicationDidFinishLaunching, func(evt *Event) {
|
||||
// Do we need to do anything now?
|
||||
fmt.Println("events.Mac.ApplicationDidFinishLaunching received!")
|
||||
})
|
||||
|
||||
return appRun(m.application)
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
//go:build linux
|
||||
|
||||
package application
|
||||
|
||||
import "github.com/wailsapp/wails/v3/pkg/events"
|
||||
|
||||
var commonApplicationEventMap = map[events.ApplicationEventType]events.ApplicationEventType{
|
||||
events.Linux.SystemThemeChanged: events.Common.ThemeChanged,
|
||||
}
|
||||
|
||||
func (m *linuxApp) setupCommonEvents() {
|
||||
for sourceEvent, targetEvent := range commonApplicationEventMap {
|
||||
sourceEvent := sourceEvent
|
||||
targetEvent := targetEvent
|
||||
m.parent.On(sourceEvent, func(event *Event) {
|
||||
event.Id = uint(targetEvent)
|
||||
applicationEvents <- event
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user