mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[v3 linux] purego: windowGetRelativePosition
This commit is contained in:
@@ -691,6 +691,17 @@ func windowGetCurrentMonitorGeometry(window pointer) (x int, y int, width int, h
|
||||
return int(result.x), int(result.y), int(result.width), int(result.height), gdkMonitorGetScaleFactor(monitor)
|
||||
}
|
||||
|
||||
func windowGetRelativePosition(window pointer) (int, int) {
|
||||
absX, absY := windowGetAbsolutePosition(window)
|
||||
x, y, _, _, _ := windowGetCurrentMonitorGeometry(window)
|
||||
|
||||
relX := absX - x
|
||||
relY := absY - y
|
||||
|
||||
// TODO: Scale based on DPI
|
||||
return relX, relY
|
||||
}
|
||||
|
||||
func windowGetSize(window pointer) (int, int) {
|
||||
// TODO: dispatchOnMainThread?
|
||||
var width, height int
|
||||
|
||||
Reference in New Issue
Block a user