Remove all systray related for v2. (#2329)

Possible fix for #2265. Close systray separately after the application ran.
This commit is contained in:
Sebastian Bauer
2023-01-26 18:11:31 +11:00
committed by GitHub
parent c34c761c5f
commit 180eef34a2
26 changed files with 0 additions and 2643 deletions
-18
View File
@@ -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
}