5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-21 03:19:31 +08:00

[v3 linux] webview setAbsolutePosition

This commit is contained in:
Travis McLane 2023-06-23 15:49:37 -05:00
parent 1a09a8a4c8
commit 5a40f25d03

View File

@ -373,6 +373,23 @@ func (w *linuxWebviewWindow) height() int {
return height
}
func (w *linuxWebviewWindow) setAbsolutePosition(x int, y int) {
// Set the window's absolute position
windowMove(w.window, x, y)
}
func (w *linuxWebviewWindow) absolutePosition() (int, int) {
var x, y int
var wg sync.WaitGroup
wg.Add(1)
globalApplication.dispatchOnMainThread(func() {
x, y = windowGetAbsolutePosition(w.window)
wg.Done()
})
wg.Wait()
return x, y
}
func (w *linuxWebviewWindow) run() {
for eventId := range w.parent.eventListeners {
w.on(eventId)