mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Remove all systray related for v2. (#2329)
Possible fix for #2265. Close systray separately after the application ran.
This commit is contained in:
@@ -14,9 +14,6 @@ type Application struct {
|
||||
application *app.App
|
||||
options *options.App
|
||||
|
||||
// System Trays
|
||||
systemTrays []*SystemTray
|
||||
|
||||
// running flag
|
||||
running bool
|
||||
|
||||
@@ -52,11 +49,6 @@ func (a *Application) SetApplicationMenu(appMenu *menu.Menu) {
|
||||
|
||||
// Run starts the application
|
||||
func (a *Application) Run() error {
|
||||
|
||||
for _, systemtray := range a.systemTrays {
|
||||
go systemtray.run()
|
||||
}
|
||||
|
||||
err := applicationInit()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -78,16 +70,12 @@ func (a *Application) Run() error {
|
||||
a.running = true
|
||||
|
||||
err = a.application.Run()
|
||||
a.Quit()
|
||||
return err
|
||||
}
|
||||
|
||||
// Quit will shut down the application
|
||||
func (a *Application) Quit() {
|
||||
a.shutdown.Do(func() {
|
||||
for _, systray := range a.systemTrays {
|
||||
systray.Close()
|
||||
}
|
||||
a.application.Shutdown()
|
||||
})
|
||||
}
|
||||
@@ -112,9 +100,3 @@ func (a *Application) On(eventType EventType, callback func()) {
|
||||
a.options.OnDomReady = c
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Application) NewSystemTray(options *options.SystemTray) *SystemTray {
|
||||
systemTray := newSystemTray(options)
|
||||
a.systemTrays = append(a.systemTrays, systemTray)
|
||||
return systemTray
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user