From 8ca9999ea64fe4da86ac0bd9e664c1dd479876f2 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sat, 8 Jan 2011 19:04:53 +0100 Subject: [PATCH] Fix for dragging full screen window in Spaces Ensure the full screen window is still covering the screen after having dragged it in Spaces (or moved it in any other manner). --- src/MacVim/MMFullscreenWindow.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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.