Bring linux up to date with dev changes

This commit is contained in:
Lea Anthony 2024-01-21 21:24:30 +11:00
commit b249f0d0ce
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
3 changed files with 17 additions and 14 deletions

View file

@ -0,0 +1,8 @@
package assetserver
import "net/url"
var baseURL = url.URL{
Scheme: "wails",
Host: "localhost",
}

View file

@ -56,6 +56,8 @@ func GenerateAppImage(options *GenerateAppImageOptions) error {
return err
}
pterm.Println(pterm.LightYellow("AppImage Generator v1.0.0"))
return generateAppImage(options)
}
@ -155,7 +157,7 @@ func generateAppImage(options *GenerateAppImageOptions) error {
}
// Run linuxdeploy to bundle the application
s.CD(options.BuildDir)
log(p, "Generating AppImage (This may take a while...)")
//log(p, "Generating AppImage (This may take a while...)")
cmd := fmt.Sprintf("./linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir %s --output appimage --plugin gtk", appDir)
s.SETENV("DEPLOY_GTK_VERSION", DeployGtkVersion)
output, err := s.EXEC(cmd)

View file

@ -4,9 +4,8 @@ package application
import (
"fmt"
"github.com/wailsapp/wails/v3/internal/assetserver"
"github.com/wailsapp/wails/v3/internal/capabilities"
"net/url"
"github.com/wailsapp/wails/v3/pkg/events"
)
@ -249,15 +248,6 @@ func (w *linuxWebviewWindow) execJS(js string) {
}
func (w *linuxWebviewWindow) setURL(uri string) {
if uri != "" {
url, err := url.Parse(uri)
if err == nil && url.Scheme == "" && url.Host == "" {
// TODO handle this in a central location, the scheme and host might be platform dependant.
url.Scheme = "wails"
url.Host = "wails"
uri = url.String()
}
}
windowSetURL(w.webview, uri)
}
@ -407,9 +397,12 @@ func (w *linuxWebviewWindow) run() {
w.fullscreen()
}
if w.parent.options.URL != "" {
w.setURL(w.parent.options.URL)
startURL, err := assetserver.GetStartURL(w.parent.options.URL)
if err != nil {
globalApplication.fatal(err.Error())
}
w.setURL(startURL)
// We need to wait for the HTML to load before we can execute the javascript
// FIXME: What event is this? DomReady?
w.parent.On(events.Mac.WebViewDidFinishNavigation, func(_ *WindowEvent) {