{"action":"created","issue":{"url":"https://api.github.com/repos/macvim-dev/macvim/issues/5","labels_url":"https://api.github.com/repos/macvim-dev/macvim/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/macvim-dev/macvim/issues/5/comments","events_url":"https://api.github.com/repos/macvim-dev/macvim/issues/5/events","html_url":"https://github.com/macvim-dev/macvim/pull/5","id":68812883,"number":5,"title":"Early-out of resize handling if the window has not been presented yet.","user":{"login":"jpetrie","id":1852647,"avatar_url":"https://avatars.githubusercontent.com/u/1852647?v=3","gravatar_id":"","url":"https://api.github.com/users/jpetrie","html_url":"https://github.com/jpetrie","followers_url":"https://api.github.com/users/jpetrie/followers","following_url":"https://api.github.com/users/jpetrie/following{/other_user}","gists_url":"https://api.github.com/users/jpetrie/gists{/gist_id}","starred_url":"https://api.github.com/users/jpetrie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpetrie/subscriptions","organizations_url":"https://api.github.com/users/jpetrie/orgs","repos_url":"https://api.github.com/users/jpetrie/repos","events_url":"https://api.github.com/users/jpetrie/events{/privacy}","received_events_url":"https://api.github.com/users/jpetrie/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-15T23:57:10Z","updated_at":"2015-04-27T12:43:14Z","closed_at":"2015-04-27T06:31:17Z","pull_request":{"url":"https://api.github.com/repos/macvim-dev/macvim/pulls/5","html_url":"https://github.com/macvim-dev/macvim/pull/5","diff_url":"https://github.com/macvim-dev/macvim/pull/5.diff","patch_url":"https://github.com/macvim-dev/macvim/pull/5.patch"},"body":"This change address an issue I noticed on OS 10.10.3 when MacVim starts up and tries to restore a saved window position to a location on a secondary monitor.\r\n\r\nWhen that happens, MacVim's attempt to set the window's position before it actually becomes visible will trigger a resize event (because the window moved from one NSScreen to another), even though the actual size of the window frame doesn't change. This resize event occurs too early, before the window's size constraints based on the initial rows/columns setting from Vim have been corrected set up. This causes the window to appear at the proper size briefly and then immediate shrink to a size based on the window's default, small frame.\r\n\r\nBy ensuring that the window controller does not propagate logic from the resize event until the window has been fully presented, the issue is avoided.\r\n\r\nI am fairly certain this is a safe, clean way to accomplish this. Moving around where `setupDone` is set to `YES` was another approach, but given the number of checks against `setupDone` in the controller I thought it might be too risky. It is, however, the first change I've attempted to make in MacVim's source so I could be missing a critical piece of logic.\r\n\r\nMy testing hasn't revealed any issues so far. I've run MacVim with my current set of RC files, as well as via `mvim -u NONE` and `mvim -u NONE -c 'set columns=X'` and so on (in both cases, with and without nuking the autosaved window size user defaults). Everything appears normal."},"comment":{"url":"https://api.github.com/repos/macvim-dev/macvim/issues/comments/96636174","html_url":"https://github.com/macvim-dev/macvim/pull/5#issuecomment-96636174","issue_url":"https://api.github.com/repos/macvim-dev/macvim/issues/5","id":96636174,"user":{"login":"chdiza","id":3311113,"avatar_url":"https://avatars.githubusercontent.com/u/3311113?v=3","gravatar_id":"","url":"https://api.github.com/users/chdiza","html_url":"https://github.com/chdiza","followers_url":"https://api.github.com/users/chdiza/followers","following_url":"https://api.github.com/users/chdiza/following{/other_user}","gists_url":"https://api.github.com/users/chdiza/gists{/gist_id}","starred_url":"https://api.github.com/users/chdiza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chdiza/subscriptions","organizations_url":"https://api.github.com/users/chdiza/orgs","repos_url":"https://api.github.com/users/chdiza/repos","events_url":"https://api.github.com/users/chdiza/events{/privacy}","received_events_url":"https://api.github.com/users/chdiza/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T12:43:14Z","updated_at":"2015-04-27T12:43:14Z","body":"This seems to have caused an ugly white flash inside the MacVim window's rectangle upon first doing Cmd-N, or doing `mvim foo` at the terminal.  I'm on 10.10.3."}}