On windows/arm64 Wails beta.24's SetZoom fails with ErrDoubleArgUnsupported and only logs it: Go's stdcall on arm64 loads x0-x7 and never d0 (golang/go#62583), so ICoreWebView2Controller:: put_ZoomFactor(double) can't be called through SyscallN. The text size was saved and never applied. zoom_windows_arm64.go calls put_ZoomFactor (vtbl slot 8) through a two-instruction thunk in VirtualAlloc'd executable memory, `fmov d0, x1; br x2`, called as SyscallN(thunk, this, bits, fn). The controller is reached by reflection (WebviewWindow.impl.chromium. controller). The window's Zoom option goes through the same broken call, so on that platform the size is put on each page once navigation completes (zoomsAfterLoad), on the UI thread. Other platforms are unchanged: setPageZoom moves to zoom_other.go. Run: - The thunk's encoding in a C harness on macOS arm64 (MAP_JIT): it passed 1.25 in d0, returned the callee's HRESULT, kept `this`. - On the Windows 11 AMD64 box, in a sandbox profile on its own port, a check build of this change (same reflection path and vtbl slot, the call made directly since amd64 passes doubles in X1): put_ZoomFactor returned S_OK for both windows at 110% and 150%, and screenshots show the page drawn at 150%. - gofmt -l; go vet ./... darwin, GOOS=linux -tags nogui, GOOS=windows, and GOOS=windows GOARCH=arm64 (vet + build); go test ./internal/gui/. Not tried: the thunk on real Windows on ARM hardware; the reporter is asked to confirm. No GUI assets changed, so the Playwright suite wasn't run.
13 lines
424 B
Go
13 lines
424 B
Go
//go:build !darwin && !nogui && !(windows && arm64)
|
|
|
|
package gui
|
|
|
|
import "github.com/wailsapp/wails/v3/pkg/application"
|
|
|
|
// setPageZoom zooms w's page to z, as a browser zooms (WebView2's zoom
|
|
// factor, WebKitGTK's zoom level): the text size.
|
|
func setPageZoom(w *application.WebviewWindow, z float64) { w.SetZoom(z) }
|
|
|
|
// zoomsAfterLoad: the window takes its text size with its options (Zoom).
|
|
const zoomsAfterLoad = false
|