From e35b0a69a7dc35cc4af85fbbce8160ed0ff8ea9c Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Sat, 18 Aug 2018 20:36:07 -0700 Subject: [PATCH] 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. --- src/MacVim/MMWindowController.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 5f8b5058b5..1003d3b451 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -363,11 +363,9 @@ // HACK! This method moves a window to a new origin and to a different // screen. This is primarily useful to avoid a scenario where such a move // will trigger a resize, even though the frame didn't actually change size. - // This method should not be called unless the new origin is definitely on - // a different screen, otherwise the next legitimate resize message will - // be skipped. resizingDueToMove = YES; [[self window] setFrameTopLeftPoint:topLeft]; + resizingDueToMove = NO; } - (void)updateTabsWithData:(NSData *)data