mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Refactor app for linux
This commit is contained in:
parent
d319d51fcd
commit
03dd514768
5 changed files with 12 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/wailsapp/wails/v2
|
||||
|
||||
go 1.19
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver v1.5.0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//go:build !dev && !production && !bindings && darwin
|
||||
//go:build !dev && !production && !bindings && (linux || darwin)
|
||||
|
||||
package app
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//go:build unix && !bindings
|
||||
//go:build (linux || darwin) && !bindings
|
||||
|
||||
package app
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -861,8 +861,6 @@ func (w *Window) Run(url string) {
|
|||
w.Maximise()
|
||||
}
|
||||
|
||||
C.gtk_main()
|
||||
w.Destroy()
|
||||
}
|
||||
|
||||
func (w *Window) SetKeepAbove(top bool) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue