From 4402b24fcf0bd4418e6ab99bd043a56f29256575 Mon Sep 17 00:00:00 2001 From: Alexander Rauchfuss Date: Sat, 16 Oct 2010 12:19:56 -0400 Subject: [PATCH] Fixed bug with fullscreen controls being visible while SC was inactive. --- Session/TSSTSessionWindowController.h | 3 +++ Session/TSSTSessionWindowController.m | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Session/TSSTSessionWindowController.h b/Session/TSSTSessionWindowController.h index 85e29cb3..6154c6c4 100644 --- a/Session/TSSTSessionWindowController.h +++ b/Session/TSSTSessionWindowController.h @@ -177,6 +177,7 @@ enum PageSelectionMode { - (void)restoreSession; - (void)prepareToEnd; + - (void)refreshLoupePanel; - (void)infoPanelSetupAtPoint:(NSPoint)point; @@ -202,6 +203,8 @@ enum PageSelectionMode { - (TSSTManagedSession *)session; - (NSManagedObjectContext *)managedObjectContext; - (void)toolbarWillAddItem:(NSNotification *)notification; +- (void)deactivate:(NSNotification *)notification; + /* Methods that kill page expose, the loupe, and fullscreen. In that order. */ diff --git a/Session/TSSTSessionWindowController.m b/Session/TSSTSessionWindowController.m index ec52c661..d3850509 100644 --- a/Session/TSSTSessionWindowController.m +++ b/Session/TSSTSessionWindowController.m @@ -166,6 +166,7 @@ - (void)awakeFromNib [pageScrollView setPostsFrameChangedNotifications: YES]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(resizeView) name: NSViewFrameDidChangeNotification object: pageScrollView]; + [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(deactivate:) name: NSApplicationDidResignActiveNotification object: NSApp]; [pageController addObserver: self forKeyPath: @"selectionIndex" options: 0 context: nil]; [pageController addObserver: self forKeyPath: @"arrangedObjects.@count" options: 0 context: nil]; @@ -359,7 +360,7 @@ - (void)mouseMoved:(NSEvent *)theEvent [self infoPanelSetupAtPoint: windowLocation]; } } - else if(NSMouseInRect(screenLocation, fullscreenFrame, NO)) + else if(NSMouseInRect(screenLocation, fullscreenFrame, NO) && [NSApp isActive]) { [[self window] addChildWindow: bezelWindow ordered: NSWindowAbove]; [bezelWindow makeKeyWindow]; @@ -1711,6 +1712,12 @@ - (void)windowDidResignKey:(NSNotification *)aNotification } } +- (void)deactivate:(NSNotification *)notification +{ + [[bezelWindow parentWindow] removeChildWindow: bezelWindow]; + [bezelWindow orderOut: self]; +} + - (NSSize)windowWillResize:(NSWindow *)resizeWindow toSize:(NSSize)newSize