diff --git a/src/MacVim/MMFullscreenWindow.m b/src/MacVim/MMFullscreenWindow.m index 2632198080..dc132090d6 100644 --- a/src/MacVim/MMFullscreenWindow.m +++ b/src/MacVim/MMFullscreenWindow.m @@ -42,6 +42,7 @@ - (BOOL)isOnPrimaryScreen; - (void)handleWindowDidBecomeMainNotification:(NSNotification *)notification; - (void)handleWindowDidResignMainNotification:(NSNotification *)notification; +- (void)windowDidMove:(NSNotification *)notification; - (void)applicationDidChangeScreenParameters:(NSNotification *)notification; - (void)resizeVimView; @end @@ -90,6 +91,11 @@ name:NSWindowDidResignMainNotification object:self]; + [nc addObserver:self + selector:@selector(windowDidMove:) + name:NSWindowDidMoveNotification + object:self]; + [nc addObserver:self selector:@selector(applicationDidChangeScreenParameters:) name:NSApplicationDidChangeScreenParametersNotification @@ -379,6 +385,17 @@ } } +- (void)windowDidMove:(NSNotification *)notification +{ + // Window may move as a result of being dragged between Spaces. + ASLogDebug(@"Full screen window moved, ensuring it covers the screen..."); + + // Ensure the full screen window is still covering the entire screen and + // then resize view according to 'fuopt'. + [self setFrame:[[self screen] frame] display:NO]; + [self resizeVimView]; +} + - (void)applicationDidChangeScreenParameters:(NSNotification *)notification { // This notification is sent when screen resolution may have changed (e.g.