mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-21 11:29:29 +08:00
[v3 linux] webview setAbsolutePosition
This commit is contained in:
parent
1a09a8a4c8
commit
5a40f25d03
@ -373,6 +373,23 @@ func (w *linuxWebviewWindow) height() int {
|
|||||||
return height
|
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() {
|
func (w *linuxWebviewWindow) run() {
|
||||||
for eventId := range w.parent.eventListeners {
|
for eventId := range w.parent.eventListeners {
|
||||||
w.on(eventId)
|
w.on(eventId)
|
||||||
|
Loading…
Reference in New Issue
Block a user