mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
Bring linux up to date with dev changes
This commit is contained in:
parent
6522657893
commit
b249f0d0ce
3 changed files with 17 additions and 14 deletions
8
v3/internal/assetserver/assetserver_linux.go
Normal file
8
v3/internal/assetserver/assetserver_linux.go
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
package assetserver
|
||||
|
||||
import "net/url"
|
||||
|
||||
var baseURL = url.URL{
|
||||
Scheme: "wails",
|
||||
Host: "localhost",
|
||||
}
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue