mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-12 06:59:30 +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) {
|
func (w *windowsWebviewWindow) execJS(js string) {
|
||||||
|
if w.chromium == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
globalApplication.dispatchOnMainThread(func() {
|
globalApplication.dispatchOnMainThread(func() {
|
||||||
w.chromium.Eval(js)
|
w.chromium.Eval(js)
|
||||||
})
|
})
|
||||||
@ -210,6 +213,8 @@ func (w *windowsWebviewWindow) run() {
|
|||||||
panic("Unable to create window")
|
panic("Unable to create window")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w.setupChromium()
|
||||||
|
|
||||||
// Register the window with the application
|
// Register the window with the application
|
||||||
getNativeApplication().registerWindow(w)
|
getNativeApplication().registerWindow(w)
|
||||||
|
|
||||||
@ -292,8 +297,6 @@ func (w *windowsWebviewWindow) run() {
|
|||||||
w.Focus()
|
w.Focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
w.setupChromium()
|
|
||||||
|
|
||||||
if !options.Hidden {
|
if !options.Hidden {
|
||||||
w.show()
|
w.show()
|
||||||
w.update()
|
w.update()
|
||||||
@ -323,6 +326,7 @@ func (w *windowsWebviewWindow) size() (int, int) {
|
|||||||
rect := w32.GetWindowRect(w.hwnd)
|
rect := w32.GetWindowRect(w.hwnd)
|
||||||
width := int(rect.Right - rect.Left)
|
width := int(rect.Right - rect.Left)
|
||||||
height := int(rect.Bottom - rect.Top)
|
height := int(rect.Bottom - rect.Top)
|
||||||
|
// Scaling appears to give invalid results...
|
||||||
//width, height = w.scaleToDefaultDPI(width, height)
|
//width, height = w.scaleToDefaultDPI(width, height)
|
||||||
return width, height
|
return width, height
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user