@@ -150,6 +150,8 @@ - (id)initWithVimController:(MMVimController *)controller
150150 self = [super initWithWindow: win];
151151 if (!self) return nil ;
152152
153+ resizingDueToMove = NO ;
154+
153155 vimController = controller;
154156 decoratedWindow = [win retain ];
155157
@@ -347,6 +349,18 @@ - (BOOL)presentWindow:(id)unused
347349 return YES ;
348350}
349351
352+ - (void )moveWindowAcrossScreens : (NSPoint )topLeft
353+ {
354+ // HACK! This method moves a window to a new origin and to a different
355+ // screen. This is primarily useful to avoid a scenario where such a move
356+ // will trigger a resize, even though the frame didn't actually change size.
357+ // This method should not be called unless the new origin is definitely on
358+ // a different screen, otherwise the next legitimate resize message will
359+ // be skipped.
360+ resizingDueToMove = YES ;
361+ [[self window ] setFrameTopLeftPoint: topLeft];
362+ }
363+
350364- (void )updateTabsWithData : (NSData *)data
351365{
352366 [vimView updateTabsWithData: data];
@@ -993,7 +1007,13 @@ - (void)windowDidMove:(NSNotification *)notification
9931007
9941008- (void )windowDidResize : (id )sender
9951009{
996- if (!setupDone || fullScreenEnabled || !windowPresented) return ;
1010+ if (resizingDueToMove)
1011+ {
1012+ resizingDueToMove = NO ;
1013+ return ;
1014+ }
1015+
1016+ if (!setupDone || fullScreenEnabled) return ;
9971017
9981018 // NOTE: Since we have no control over when the window may resize (Cocoa
9991019 // may resize automatically) we simply set the view to fill the entire
0 commit comments