| 1 | //go:build windows |
| 2 | // +build windows |
| 3 | |
| 4 | package edge |
| 5 | |
| 6 | import ( |
| 7 | "unsafe" |
| 8 | |
| 9 | "github.com/wailsapp/go-webview2/internal/w32" |
| 10 | "golang.org/x/sys/windows" |
| 11 | ) |
| 12 | |
| 13 | func (e *Chromium) SetSize(bounds w32.Rect) { |
| 14 | if e.controller == nil { |
| 15 | return |
| 16 | } |
| 17 | |
| 18 | words := (*[2]uintptr)(unsafe.Pointer(&bounds)) |
| 19 | hr, _, _ := e.controller.vtbl.PutBounds.Call( |
| 20 | uintptr(unsafe.Pointer(e.controller)), |
| 21 | words[0], |
| 22 | words[1], |
| 23 | ) |
| 24 | if windows.Handle(hr) != windows.S_OK { |
| 25 | e.errorCallback(windows.Errno(hr)) |
| 26 | } |
| 27 | } |
| 28 |