{"action":"created","issue":{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/485","labels_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/485/labels{/name}","comments_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/485/comments","events_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/485/events","html_url":"https://github.com/Hammerspoon/hammerspoon/issues/485","id":100395974,"number":485,"title":"setFrame() doesn't work on window taller than resolution","user":{"login":"drogers141","id":1133719,"avatar_url":"https://avatars.githubusercontent.com/u/1133719?v=3","gravatar_id":"","url":"https://api.github.com/users/drogers141","html_url":"https://github.com/drogers141","followers_url":"https://api.github.com/users/drogers141/followers","following_url":"https://api.github.com/users/drogers141/following{/other_user}","gists_url":"https://api.github.com/users/drogers141/gists{/gist_id}","starred_url":"https://api.github.com/users/drogers141/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drogers141/subscriptions","organizations_url":"https://api.github.com/users/drogers141/orgs","repos_url":"https://api.github.com/users/drogers141/repos","events_url":"https://api.github.com/users/drogers141/events{/privacy}","received_events_url":"https://api.github.com/users/drogers141/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-11T19:58:50Z","updated_at":"2015-08-22T00:34:49Z","closed_at":null,"body":"Hey All,\r\nNot sure if that is the only factor involved, but it appears to be the salient issue.\r\nMy use case:\r\nMy application:\r\nhttps://github.com/drogers141/mac-hammerspoon\r\n\r\nAs part of this work, I can save the state of windows in a data structure that is also serialized to json.  The data structure maintains a queue for each \"visibility context\" that windows may be encountered in.  This is mainly the permutation of which desktop the window is in (ie Space), and on which screen.  The screens I use are currently either the laptop - a mbp - or a 26 inch Dell.  When I plug the laptop into the monitor, I can hit a key combination and any of the same windows by id from the last time the monitor was in use will be restored to their current position.  If they are not the same window, but from the same app, they will be restored to the last position of a window with that app title if there is one.  The procedure is the same when I unplug the mbp from the monitor.\r\n\r\nI recently ported this application from Hydra to Hammerspoon and generally things work the same.  Except now it seems that when I go from laptop to monitor, everything is fine, but when I go from monitor to laptop windows which are taller than the screen resolution are ignored in the resizing process.  Once I have given them focus, I can hit the keybinding to restore state and they will be correctly resized.\r\n\r\nEarlier today, I spent time working in the Hammerspoon console confirming this behavior.  Indeed, when I get a reference to a window that is taller than the screen and has not been given focus yet, a call to setFrame() returns the reference correctly, but does not resize the window.  But once it has been given focus, setFrame() works on the same window reference.  Note also that as a side effect of giving the window focus for the first time, the macbook automatically resizes the window to butt to the Dock, and I am not sure if the fact that it is shorter is why setFrame will then work.\r\n\r\nPlease let me know if I can give more details, thanks.\r\nDave Rogers - dave@drogers.us\r\n"},"comment":{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/comments/133603078","html_url":"https://github.com/Hammerspoon/hammerspoon/issues/485#issuecomment-133603078","issue_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/485","id":133603078,"user":{"login":"lowne","id":6718755,"avatar_url":"https://avatars.githubusercontent.com/u/6718755?v=3","gravatar_id":"","url":"https://api.github.com/users/lowne","html_url":"https://github.com/lowne","followers_url":"https://api.github.com/users/lowne/followers","following_url":"https://api.github.com/users/lowne/following{/other_user}","gists_url":"https://api.github.com/users/lowne/gists{/gist_id}","starred_url":"https://api.github.com/users/lowne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowne/subscriptions","organizations_url":"https://api.github.com/users/lowne/orgs","repos_url":"https://api.github.com/users/lowne/repos","events_url":"https://api.github.com/users/lowne/events{/privacy}","received_events_url":"https://api.github.com/users/lowne/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T00:34:49Z","updated_at":"2015-08-22T00:34:49Z","body":"@drogers141 is there a way to reproduce manually? (i.e. without attaching/detaching screens) I briefly tried making a window 2x as tall as the screen manually, reloading HS, getting a window reference, and calling setFrame - works as expected."}}