Skip to content

Commit e35b0a6

Browse files
committed
Fix opening window in another screen resulting in broken rendering
Fix the issue that MacVim's window will have broken rendering (wrong Vim size) if the window was opened in another monitor. This was introduced as part of the implementation for guioptions 'k', The issue was that the function `moveWindowAcrossScreens` was buggy. It sets a flag "resizingDueToMove" but doesn't unset it after the `setFrameTopLeftPoint`, which may or may not call the resize function that is responsible in unsetting "resizeDueToMove". Fix the function to always unset it so that the flag doesn't leak till the next resize. Previously it "worked" due to MacVim's excessive resize messages masking the issue.
1 parent 0065c3f commit e35b0a6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/MacVim/MMWindowController.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,9 @@ - (void)moveWindowAcrossScreens:(NSPoint)topLeft
363363
// HACK! This method moves a window to a new origin and to a different
364364
// screen. This is primarily useful to avoid a scenario where such a move
365365
// will trigger a resize, even though the frame didn't actually change size.
366-
// This method should not be called unless the new origin is definitely on
367-
// a different screen, otherwise the next legitimate resize message will
368-
// be skipped.
369366
resizingDueToMove = YES;
370367
[[self window] setFrameTopLeftPoint:topLeft];
368+
resizingDueToMove = NO;
371369
}
372370

373371
- (void)updateTabsWithData:(NSData *)data

0 commit comments

Comments
 (0)