Refactor app for linux

This commit is contained in:
Lea Anthony 2022-09-27 17:51:19 +10:00
commit 03dd514768
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
5 changed files with 12 additions and 6 deletions

View file

@ -1,6 +1,6 @@
module github.com/wailsapp/wails/v2
go 1.19
go 1.18
require (
github.com/Masterminds/semver v1.5.0

View file

@ -1,4 +1,4 @@
//go:build !dev && !production && !bindings && darwin
//go:build !dev && !production && !bindings && (linux || darwin)
package app

View file

@ -1,4 +1,4 @@
//go:build unix && !bindings
//go:build (linux || darwin) && !bindings
package app

View file

@ -52,6 +52,14 @@ type Frontend struct {
dispatcher frontend.Dispatcher
}
func (f *Frontend) RunMainLoop() {
C.gtk_main()
}
func (f *Frontend) WindowClose() {
f.mainWindow.Destroy()
}
func init() {
runtime.LockOSThread()
}
@ -85,7 +93,7 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
} else {
appBindings.DB().UpdateObfuscatedCallMap()
}
assets, err := assetserver.NewAssetServer(ctx, appoptions, bindings)
assets, err := assetserver.NewAssetServer(ctx, appoptions.Assets, appoptions.AssetsHandler, bindings)
if err != nil {
log.Fatal(err)
}

View file

@ -861,8 +861,6 @@ func (w *Window) Run(url string) {
w.Maximise()
}
C.gtk_main()
w.Destroy()
}
func (w *Window) SetKeepAbove(top bool) {