-
-
Notifications
You must be signed in to change notification settings - Fork 686
MacVim fails to initialize properly if the last saved window position is outside of current screen #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is interesting, because MacVim does realize this and adjust the window position. It happens in I can't reproduce this by forcing Does it reproduce reliably for you? Does it reproduce reliably if you run MacVim without loading your own A quick bit of poking around for information about the error message on the top of the stack trace suggests it's a low-level thing caused, potentially, by starving the window manager for window resources. When this happens are you doing a lot of other stuff with other applications that have a ton of windows open? Seems like it would be a really difficult limit to hit unless some application was somehow leaking them in the background. Or maybe MacVim is? |
Before filing this bug I've bumped into this problem a couple of times over 6 last months. This time I was finally angry and determined to trace it down. After reading your update and bit of testing it looks like there's something more at play.
More testing to follow. FWIW, I have:
in my |
I'm hitting this 100% of the time after installing El Capitan, meaning my macvim installation is completely hosed. I uninstalled the old version, cloned this repro and built from source today. I've tried mvim --fresh without luck. Here are the defaults: defaults read org.vim.MacVim I've renamed my .vim, .viminfo, .vimrc and .gvimrc to other names and relaunched. Same problem: The macvim icon appears in the doc and the menu is active, but there is no window, and no way to create a window. One clue that I can't figure out: if I right-click on the macvim icon in the dock, it displays a list of my most recently opened files. I can't figure out where that list is coming from: it persists between installs and reboots, and is not coming from any of my vim - related .dot files, since it still appears after they have all been renamed. I wonder if this is the same place macvim is getting its last known window location from the OS? If you know where that is please comment and I'll see if I can clear that. Any ideas? |
It comes from the OS I believe; you likely have it configured to "remember the last N most-recently-used documents." MacVim uses this or this to set up window positions. It would be interesting to know what decision path the latter is taking, since I've been unable to reproduce this (even on El Capitan) myself. |
Thanks for the reply. If I create an entirely new user account and run macvim from there everything works fine, so the build itself is ok. In the hosed user account I tried removing ~/Library/Preferences/org.vim.MacVim.plist altogether and that did not help. I think it's getting some unexpected value from the OS for last window position for this app for this user, but that data is stored someplace other than the dot files, and the org.vim.MacVim.plist. I'm afraid I don't know Objective C well enough to debug it better than that. |
@georgesnelling since two or versions of OSX 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 |
Alternatively: |
Thanks everyone: [gs] ~ $ defaults delete org.vim.MacVim Then launch macvim: no window. The OS must be reading that value from some other key. |
Do you have some kind of third-party window manager installed, like Slate, Divvy, etc? |
Nope, completely vanilla. |
I can reproduce this (sometimes?). I connect a large external monitor, and then close my laptop lid, so I have only one screen, on the external monitor. I open MacVim, and position it to fill the screen. Quit MacVim. Unplug the monitor to go back to the laptop screen. Look at Deleting the property with BUT: sometimes the MMTopLeftPoint property isn't set? No idea why. In that case it works fine. |
I seem to be able to reproduce this simply by setting MMTopLeftPoint:
Using MacVim 7.4 (84). |
Good catch. However I still cannot reproduce the issue on MacBook Pro 15(The resolution setting is "Default for display") with no external monitors.
MacVim opens a window and it works well. |
Hmm, I wonder if somehow it is important that I have used an external monitor in the past? Too much state.... I'm on 10.10.5, btw. |
I tried to use an external monitor, but still I can't reproduce the issue. You can 100% reproduce it using my command lines with no external monitors? |
There's a factor in my init files somewhere. Using |
FWIW, I have these in my set lines=999 " maximize window by default, vertical
set columns=999 " and horizontal Perhaps it's the wrong value and a resize that's causing this? Sorry, can't verify this on my own atm. |
Create a gvimrc_bad file with this:
Then:
This crashes for me. |
@yacoob wow, your comment appeared as I was entering mine! |
Hm, I've actually mentioned that earlier in this bug's history too. Hehe :D |
Still I can't reproduce it.
No crash. A maximum window opened and works well. You guys on 10.10.5? So it seems it is the best time to upgrade your OS X 😉 |
Yup, I'm on 10.10.5, and I'll be upgrading soon-ish. Unless MacVim requires 10.11, I still think this is a bug worth fixing :) |
confirmed. I can reproduce the issue on 10.10.5. It never happens on 10.11.2. I recommend to update OS X to solve the issue. |
I don't have enough of a repro to reopen the issue, but I believe the issue occurred for me when running 10.11.2. Hopefully I'm wrong, and this was fixed in Apple code and we'll never see it again. But if someone out there ever hits it again using builds >= 10.11.2 know that you are not entirely alone or crazy. |
@georgesnelling you said "Then launch macvim: no window.", not the crash. It sounds the exactly same as #109. |
Oh, you may well be right. I was messing around with docker at the time. I withdraw my skeptical comment. |
Czdcyuzvjjcjl. Sent from Outlook Mobile On Fri, Dec 18, 2015 at 7:27 PM -0800, "Kazuki Sakamoto" notifications@github.com wrote: Closed #66. Reply to this email directly or view it on GitHub: |
I've had Macvim failed to create its first window a couple of times with:
As a result the process keeps running, but there's no UI to interact with.
I'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.
Removing the setting makes MacVim happy again and allows it to initialize properly:
It'd be nice if MacVim would realise this on its own and didn't fail during window creation. :)
The text was updated successfully, but these errors were encountered: