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).
This commit is contained in:
Bjorn Winckler
2011-01-08 19:04:53 +01:00
parent 0e9b4e11b0
commit 8ca9999ea6
+17
View File
@@ -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.