{"action":"created","issue":{"url":"https://api.github.com/repos/macvim-dev/macvim/issues/66","labels_url":"https://api.github.com/repos/macvim-dev/macvim/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/macvim-dev/macvim/issues/66/comments","events_url":"https://api.github.com/repos/macvim-dev/macvim/issues/66/events","html_url":"https://github.com/macvim-dev/macvim/issues/66","id":102355973,"number":66,"title":"MacVim fails to initialize properly if the last saved window position is outside of current screen","user":{"login":"yacoob","id":190463,"avatar_url":"https://avatars.githubusercontent.com/u/190463?v=3","gravatar_id":"","url":"https://api.github.com/users/yacoob","html_url":"https://github.com/yacoob","followers_url":"https://api.github.com/users/yacoob/followers","following_url":"https://api.github.com/users/yacoob/following{/other_user}","gists_url":"https://api.github.com/users/yacoob/gists{/gist_id}","starred_url":"https://api.github.com/users/yacoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yacoob/subscriptions","organizations_url":"https://api.github.com/users/yacoob/orgs","repos_url":"https://api.github.com/users/yacoob/repos","events_url":"https://api.github.com/users/yacoob/events{/privacy}","received_events_url":"https://api.github.com/users/yacoob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-21T11:24:49Z","updated_at":"2015-10-29T20:35:20Z","closed_at":null,"body":"I've had Macvim failed to create its first window a couple of times with:\r\n\r\n```\r\n2015-08-21 12:16:53.910 MacVim[23324:151631] Error (1000) creating CGSWindow on line 281\r\n2015-08-21 12:16:53.912 MacVim[23324:151631] (\r\n        0   CoreFoundation                      0x00007fff937d103c __exceptionPreprocess + 172\r\n        1   libobjc.A.dylib                     0x00007fff90cbc76e objc_exception_throw + 43\r\n        2   CoreFoundation                      0x00007fff937d0eed +[NSException raise:format:] + 205\r\n        3   AppKit                              0x00007fff98e86cc2 _NSCreateWindowWithOpaqueShape2 + 1417\r\n        4   AppKit                              0x00007fff98e84f48 -[NSWindow _commonAwake] + 1877\r\n        5   AppKit                              0x00007fff98f0fa19 -[NSWindow _makeKeyRegardlessOfVisibility] + 85\r\n        6   AppKit                              0x00007fff98f0f98e -[NSWindow makeKeyAndOrderFront:] + 27\r\n        7   MacVim                              0x000000010823481d -[MMWindowController presentWindow:] + 147\r\n        8   Foundation                          0x00007fff9673b4eb __NSFireDelayedPerform + 364\r\n        9   CoreFoundation                      0x00007fff937242e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20\r\n        10  CoreFoundation                      0x00007fff93723f73 __CFRunLoopDoTimer + 1059\r\n        11  CoreFoundation                      0x00007fff9379753d __CFRunLoopDoTimers + 301\r\n        12  CoreFoundation                      0x00007fff936df608 __CFRunLoopRun + 2024\r\n        13  CoreFoundation                      0x00007fff936debd8 CFRunLoopRunSpecific + 296\r\n        14  HIToolbox                           0x00007fff8fbc656f RunCurrentEventLoopInMode + 235\r\n        15  HIToolbox                           0x00007fff8fbc62ea ReceiveNextEventCommon + 431\r\n        16  HIToolbox                           0x00007fff8fbc612b _BlockUntilNextEventMatchingListInModeWithFilter + 71\r\n        17  AppKit                              0x00007fff98e738ab _DPSNextEvent + 978\r\n        18  AppKit                              0x00007fff98e72e58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346\r\n        19  AppKit                              0x00007fff98e68af3 -[NSApplication run] + 594\r\n        20  AppKit                              0x00007fff98de5244 NSApplicationMain + 1832\r\n        21  libdyld.dylib                       0x00007fff8cbbd5c9 start + 1\r\n```\r\n\r\nAs a result the process keeps running, but there's no UI to interact with.\r\n\r\nI've traced it down to MacVim trying to restore its window in a place that is outside of current screen. This happens when I work on a macbook with a large external display connected, quit MacVim, disconnect the display, then try to launch MacVim again.\r\n\r\n```\r\n$ defaults read org.vim.MacVim MMTopLeftPoint\r\n{4, 1577}\r\n$ osascript -e 'tell application \"Finder\" to get bounds of window of desktop'\r\n0, 0, 1680, 1050\r\n```\r\n\r\nRemoving the setting makes MacVim happy again and allows it to initialize properly:\r\n\r\n```\r\n$ defaults delete org.vim.MacVim MMTopLeftPoint\r\n```\r\n\r\nIt'd be nice if MacVim would realise this on its own and didn't fail during window creation. :)"},"comment":{"url":"https://api.github.com/repos/macvim-dev/macvim/issues/comments/152310526","html_url":"https://github.com/macvim-dev/macvim/issues/66#issuecomment-152310526","issue_url":"https://api.github.com/repos/macvim-dev/macvim/issues/66","id":152310526,"user":{"login":"yacoob","id":190463,"avatar_url":"https://avatars.githubusercontent.com/u/190463?v=3","gravatar_id":"","url":"https://api.github.com/users/yacoob","html_url":"https://github.com/yacoob","followers_url":"https://api.github.com/users/yacoob/followers","following_url":"https://api.github.com/users/yacoob/following{/other_user}","gists_url":"https://api.github.com/users/yacoob/gists{/gist_id}","starred_url":"https://api.github.com/users/yacoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yacoob/subscriptions","organizations_url":"https://api.github.com/users/yacoob/orgs","repos_url":"https://api.github.com/users/yacoob/repos","events_url":"https://api.github.com/users/yacoob/events{/privacy}","received_events_url":"https://api.github.com/users/yacoob/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T20:35:20Z","updated_at":"2015-10-29T20:35:20Z","body":"@georgesnelling since two or versions or so, removing plist is no longer sufficient, as preferences are cached by a system daemon. If you want to test this, you need to rm the file and then `killall cfprefsd`."}}