kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

Setting a window frame to a different screen results in incorrect height #349

Closed metakirby5 closed 2 months ago

metakirby5 commented 3 months ago

Likely related to #348, since:

Example (in Coffeescript, but the syntax is similar enough to Javascript):

currentWindow = Window.focused()
sf = currentWindow.screen().frame()
wf = currentWindow.frame()
wf.x = 0
wf.y = 0
wf.height = sf.height
Phoenix.log("Before screen height: #{currentWindow.screen().frame().height}")
Phoenix.log(currentWindow.setFrame(wf))
Phoenix.log("After screen height: #{currentWindow.screen().frame().height}")
Phoenix.log("#{wf.height} -> #{currentWindow.frame().height}")

Logs:

default 21:35:15.212393+0900    Phoenix Before screen height: 1117
default 21:35:15.390630+0900    Phoenix false
default 21:35:15.402436+0900    Phoenix After screen height: 1440
default 21:35:15.404335+0900    Phoenix 1117 -> 1092
metakirby5 commented 3 months ago

Confirmed the issue is fixed with #350.