mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-10 22:19:46 +08:00
[v3 windows] Setup chromium sooner
This commit is contained in:
parent
3c81fb06e8
commit
b62ce4440e
@ -146,6 +146,9 @@ func (w *windowsWebviewWindow) setMaxSize(width, height int) {
|
||||
}
|
||||
|
||||
func (w *windowsWebviewWindow) execJS(js string) {
|
||||
if w.chromium == nil {
|
||||
return
|
||||
}
|
||||
globalApplication.dispatchOnMainThread(func() {
|
||||
w.chromium.Eval(js)
|
||||
})
|
||||
@ -210,6 +213,8 @@ func (w *windowsWebviewWindow) run() {
|
||||
panic("Unable to create window")
|
||||
}
|
||||
|
||||
w.setupChromium()
|
||||
|
||||
// Register the window with the application
|
||||
getNativeApplication().registerWindow(w)
|
||||
|
||||
@ -292,8 +297,6 @@ func (w *windowsWebviewWindow) run() {
|
||||
w.Focus()
|
||||
}
|
||||
|
||||
w.setupChromium()
|
||||
|
||||
if !options.Hidden {
|
||||
w.show()
|
||||
w.update()
|
||||
@ -323,6 +326,7 @@ func (w *windowsWebviewWindow) size() (int, int) {
|
||||
rect := w32.GetWindowRect(w.hwnd)
|
||||
width := int(rect.Right - rect.Left)
|
||||
height := int(rect.Bottom - rect.Top)
|
||||
// Scaling appears to give invalid results...
|
||||
//width, height = w.scaleToDefaultDPI(width, height)
|
||||
return width, height
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user