Revert "[linux] Implement events"

This reverts commit 8ddd29d285.
This commit is contained in:
Lea Anthony
2023-10-07 12:21:49 +11:00
parent ccccea1e50
commit c77c823c3c
8 changed files with 56 additions and 183 deletions
+7 -6
View File
@@ -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)
}
-20
View File
@@ -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
})
}
}