5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 08:29:40 +08:00

[windows] fix fullscreen at startup

This commit is contained in:
Lea Anthony 2021-09-22 19:28:07 +10:00
parent 29a2d5b3d8
commit fe6dd4d18f
2 changed files with 4 additions and 5 deletions

View File

@ -112,13 +112,16 @@ func (f *Frontend) Run(ctx context.Context) error {
}
})
// TODO: Move this into a callback from frontend
go func() {
if f.frontendOptions.OnStartup != nil {
f.frontendOptions.OnStartup(f.ctx)
}
}()
if f.frontendOptions.Fullscreen {
mainWindow.Fullscreen()
}
mainWindow.Run()
return nil
}

View File

@ -75,10 +75,6 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
result.SetFont(winc.DefaultFont)
if options.Fullscreen {
result.Fullscreen()
}
if options.Menu != nil {
result.SetApplicationMenu(options.Menu)
}