Swindler
Swindler copied to clipboard
Setting frame can result unexpected coordinates
Following code will produce following logs when created window goes off the screen:
print("addWindow x: \(newWindowSizes.x)")
setWindow(window: window, x: newWindowSizes.x, y: newWindowSizes.y, width: newWindowSizes.width, height: newWindowSizes.height)
.done { newRect in
self.windows.append(window)
self.newWindowSizes.x = newRect.maxX
print("new window created at minX: \(newRect.minX)")
}
addWindow x: 3840.0
setWindow: 3840.0 1280.0
Frame changed from (1280.0, 0.0, 1280.0, 1055.0) to (3800.0, 0.0, 1280.0, 1055.0), external: false
new window created at minX: 3800.0
setWindow is just wrapper for window.frame.set(rect)
How I can debug this behaviour?
@tmandry do you have any thoughts?
Usually the accessibility APIs don't allow moving a window off-screen. (It is up to the application who owns the window to decide how to respond to the request, and by default it clamps the input so enough of the window remains on-screen.)