mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
[v3 linux] webview setAbsolutePosition
This commit is contained in:
parent
1a09a8a4c8
commit
5a40f25d03
1 changed files with 17 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue