Fix initial window placement bug

The algorithm which determines the topmost window only searches through
visible windows.  The initial window placement bug was a result of this
algorithm returning the (invisible) window whose position was to be
determined.
This commit is contained in:
Bjorn Winckler
2008-04-08 13:37:21 +02:00
parent 0a54dd7370
commit 9aae3ba3cc
+4 -3
View File
@@ -741,9 +741,10 @@ static int executeInLoginShell(NSString *path, NSArray *args);
- (MMVimController *)topmostVimController
{
NSArray *windows = [NSApp orderedWindows];
if ([windows count] > 0) {
NSWindow *window = [windows objectAtIndex:0];
// Find the topmost visible window which has an associated vim controller.
NSEnumerator *e = [[NSApp orderedWindows] objectEnumerator];
id window;
while ((window = [e nextObject]) && [window isVisible]) {
unsigned i, count = [vimControllers count];
for (i = 0; i < count; ++i) {
MMVimController *vc = [vimControllers objectAtIndex:i];