Skip to content

Commit

Permalink
Ensure the current preference panel and main content controller recei…
Browse files Browse the repository at this point in the history
…ve viewWill/DidAppear notifications when the windows become key.
  • Loading branch information
clobber committed Dec 29, 2013
1 parent 271e3a7 commit 8e1b973
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OpenEmu/OEMainWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ - (void)windowWillClose:(NSNotification *)notification
[self setCurrentContentController:nil];
}

- (void)windowDidBecomeKey:(NSNotification *)notification
{
[[self currentContentController] viewWillAppear];
[[self currentContentController] viewDidAppear];
}

- (void)windowDidBecomeMain:(NSNotification *)notification
{
NSMenu *mainMenu = [NSApp mainMenu];
Expand Down
4 changes: 4 additions & 0 deletions OpenEmu/OEPreferencesController.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,14 @@ - (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet usingRec
- (void)windowWillClose:(NSNotification *)notification
{
[[self selectedPreferencePane] viewWillDisappear];
[[self selectedPreferencePane] viewDidDisappear];
}

- (void)windowDidBecomeKey:(NSNotification *)notification
{
[[self selectedPreferencePane] viewWillAppear];
[[self selectedPreferencePane] viewDidAppear];

_konamiCodeIndex = 0;
_konamiCodeMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSKeyDownMask handler:^NSEvent *(NSEvent *e) {
if([e keyCode] == konamiCode[_konamiCodeIndex])
Expand Down

0 comments on commit 8e1b973

Please sign in to comment.