Make the Find and HTML window switch back to a Space TM is actually in

This commit is contained in:
Etienne Samson
2014-07-30 17:10:51 +02:00
committed by Allan Odgaard
parent 8d9a2f5426
commit a52fc3493b
2 changed files with 29 additions and 0 deletions

View File

@@ -33,11 +33,25 @@ OAK_DEBUG_VAR(HTMLOutputWindow);
[self.window setContentBorderThickness:25 forEdge:NSMinYEdge];
[self.window setCollectionBehavior:NSWindowCollectionBehaviorMoveToActiveSpace|NSWindowCollectionBehaviorFullScreenAuxiliary];
// Register to application activation/deactivation notification so we can tweak our collection behavior
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidActivate:) name:NSApplicationDidBecomeActiveNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidDeactivate:) name:NSApplicationDidResignActiveNotification object:nil];
[OakWindowFrameHelper windowFrameHelperWithWindow:self.window];
}
return self;
}
- (void)applicationDidActivate:(NSNotification*)notification
{
self.window.collectionBehavior |= NSWindowCollectionBehaviorMoveToActiveSpace;
}
- (void)applicationDidDeactivate:(NSNotification*)notification
{
self.window.collectionBehavior &= ~NSWindowCollectionBehaviorMoveToActiveSpace;
}
+ (HTMLOutputWindowController*)HTMLOutputWindowWithRunner:(command::runner_ptr const&)aRunner
{
D(DBF_HTMLOutputWindow, bug("%s\n", to_s(aRunner->uuid()).c_str()););
@@ -103,6 +117,7 @@ OAK_DEBUG_VAR(HTMLOutputWindow);
- (void)dealloc
{
D(DBF_HTMLOutputWindow, bug("\n"););
[[NSNotificationCenter defaultCenter] removeObserver:self];
self.window.delegate = nil;
}